HISE Docs

ThreadsSafeStorage

Create a ThreadSafeStorage with Engine.createThreadSafeStorage() .

const var ThreadSafeStorage = Engine.createThreadSafeStorage();


Class methods

clear

Clears the data. If another thread tries to read the value, it will block until that operation is done. Edit on GitHub

ThreadSafeStorage.clear()



load

Loads the data. If the data is currently being written, this will lock and wait until the write operation is completed. Edit on GitHub

ThreadSafeStorage.load()



store

Writes the given data to the internal storage. If another thread tries to read the value, it will block until that operation is done. Edit on GitHub

ThreadSafeStorage.store(var dataToStore)



storeWithCopy

Creates a copy of the data and writes the copy to the data storage. If another thread tries to read the value, it will block until that operation is done. Edit on GitHub

ThreadSafeStorage.storeWithCopy(var dataToStore)



tryLoad

Loads the data if the lock can be gained or returns a given default value if the data is currently being written. Edit on GitHub

ThreadSafeStorage.tryLoad(var returnValueIfLocked)