linuxsampler 2.3.1
|
BackBuffer object to be accessed by multiple non-real-time threads. More...
#include <SynchronizedConfig.h>
Public Member Functions | |
virtual void | beginSync () OVERRIDE |
Signal intention to enter a synchronized code block. | |
virtual T & | syncedData () OVERRIDE |
Retrieve reference to critical, shared data. | |
virtual void | endSync () OVERRIDE |
Signal that the synchronized code block has been left. | |
const T & | unsafeData () const |
T & | GetConfigForUpdate () |
Gets the configuration object for use by the non real time thread. | |
const T & | GetUnsafeUpdateConfig () const |
Get the data on update side for read-only access. | |
T & | SwitchConfig () |
Atomically switch the newly updated configuration object with the one used by the real time thread, then wait for the real time thread to finish working with the old object before returning the old object. | |
BackBuffer object to be accessed by multiple non-real-time threads.
Since a back buffer is designed for being accessed by non-real-time threads, its methods involved may block the calling thread for a long amount of time.
Definition at line 303 of file SynchronizedConfig.h.
Signal intention to enter a synchronized code block.
Depending on the actual implementation, this call may block the calling thread until it is safe to actually use the protected data. After this call returns, it is safe for the calling thread to access and modify the shared data. As soon as the thread is done with accessing the shared data, it MUST call endSync().
Implements LinuxSampler::Synchronizer< T >.
Definition at line 305 of file SynchronizedConfig.h.
Signal that the synchronized code block has been left.
Depending on the actual implementation, this call may block the calling thread for a certain amount of time.
Implements LinuxSampler::Synchronizer< T >.
Definition at line 313 of file SynchronizedConfig.h.
|
inherited |
Gets the configuration object for use by the non real time thread.
The object returned is not in use by the real time thread, so it can safely be updated. After the update is done, the non real time thread must call SwitchConfig() and the same update must be done again.
Definition at line 158 of file SynchronizedConfig.h.
|
inlineinherited |
Get the data on update side for read-only access.
Definition at line 128 of file SynchronizedConfig.h.
|
inherited |
Atomically switch the newly updated configuration object with the one used by the real time thread, then wait for the real time thread to finish working with the old object before returning the old object.
SwitchConfig() must be called by the non real time thread after an update has been done, and the object returned must be updated in the same way as the first.
Definition at line 162 of file SynchronizedConfig.h.
References LinuxSampler::atomic_thread_fence(), LinuxSampler::memory_order_acquire, LinuxSampler::memory_order_release, and LinuxSampler::memory_order_seq_cst.
Retrieve reference to critical, shared data.
This method shall be called between a beginSync() and endSync() call pair, to be sure that shared data can be accessed safely.
Implements LinuxSampler::Synchronizer< T >.
Definition at line 309 of file SynchronizedConfig.h.
Definition at line 319 of file SynchronizedConfig.h.