linuxsampler 2.3.1
LinuxSampler::Synchronizer< T > Class Template Referenceabstract

Base interface class for classes that implement synchronization of data shared between multiple threads. More...

#include <SynchronizedConfig.h>

Inheritance diagram for LinuxSampler::Synchronizer< T >:
LinuxSampler::BackBuffer< T > LinuxSampler::FrontBuffer< T >

Public Member Functions

virtual void beginSync ()=0
 Signal intention to enter a synchronized code block.
 
virtual TsyncedData ()=0
 Retrieve reference to critical, shared data.
 
virtual void endSync ()=0
 Signal that the synchronized code block has been left.
 

Detailed Description

template<class T>
class LinuxSampler::Synchronizer< T >

Base interface class for classes that implement synchronization of data shared between multiple threads.

Definition at line 224 of file SynchronizedConfig.h.

Member Function Documentation

◆ beginSync()

template<class T >
virtual void LinuxSampler::Synchronizer< T >::beginSync ( )
pure virtual

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().

Returns
the shared protected data

Implemented in LinuxSampler::BackBuffer< T >, and LinuxSampler::FrontBuffer< T >.

Referenced by LinuxSampler::Sync< T >::Sync().

◆ endSync()

template<class T >
virtual void LinuxSampler::Synchronizer< T >::endSync ( )
pure virtual

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.

Implemented in LinuxSampler::BackBuffer< T >, and LinuxSampler::FrontBuffer< T >.

◆ syncedData()

template<class T >
virtual T & LinuxSampler::Synchronizer< T >::syncedData ( )
pure virtual

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.

Implemented in LinuxSampler::BackBuffer< T >, and LinuxSampler::FrontBuffer< T >.


The documentation for this class was generated from the following file: