![]() |
fpmas 1.6
|
#include <single_thread_mutex.h>
Public Member Functions | |
SingleThreadMutex (T &data) | |
T & | data () override |
const T & | data () const override |
void | lock () override |
void | unlock () override |
bool | locked () const override |
void | lockShared () override |
void | unlockShared () override |
int | sharedLockCount () const override |
![]() | |
virtual T & | data ()=0 |
virtual const T & | data () const =0 |
virtual const T & | read ()=0 |
virtual void | releaseRead ()=0 |
virtual T & | acquire ()=0 |
virtual void | releaseAcquire ()=0 |
virtual void | lock ()=0 |
virtual void | unlock ()=0 |
virtual bool | locked () const =0 |
virtual void | lockShared ()=0 |
virtual void | unlockShared ()=0 |
virtual int | sharedLockCount () const =0 |
virtual void | synchronize ()=0 |
Additional Inherited Members | |
virtual void | _lock ()=0 |
virtual void | _lockShared ()=0 |
virtual void | _unlock ()=0 |
virtual void | _unlockShared ()=0 |
A base Mutex implementation designed to work in a single threaded environment. In consequence, no concurrency management is required.
|
inline |
SingleThreadMutex constructor.
data | reference to node data |
|
inlineoverridevirtual |
Direct access to internal data representation.
Does not guarantee any concurrent access or data update management.
Implements fpmas::api::synchro::Mutex< T >.
|
inlineoverridevirtual |
Direct access to internal data representation.
Does not guarantee any concurrent access or data update management.
Implements fpmas::api::synchro::Mutex< T >.
|
inlineoverridevirtual |
Locks the mutex.
This function blocks until internal data is effectively locked. Upon return, an exclusive access to the internal data is guaranteed. However, contrary to the acquire() function, this operation does not involve any data update or write operation handling.
A locked mutex must be unlocked using unlock().
Implements fpmas::api::synchro::Mutex< T >.
|
inlineoverridevirtual |
Unlocks a mutex previously locked with lock().
Implements fpmas::api::synchro::Mutex< T >.
|
inlineoverridevirtual |
Returns true if and only if the mutex has been locked and not yet unlocked.
Implements fpmas::api::synchro::Mutex< T >.
|
inlineoverridevirtual |
Obtains a shared lock access to the mutex.
This function blocks until a shared lock access to mutex is effectively obtained. Contrary to lock(), multiple threads are allowed to simultaneously obtain a shared lock to the mutex.
The mutex must then be unlocked using unlockShared().
Implements fpmas::api::synchro::Mutex< T >.
|
inlineoverridevirtual |
Unlocks a mutex previously locked with lockShared().
Semantically, all threads that called lockShared() must call unlockShared() to finally unlock the mutex.
Implements fpmas::api::synchro::Mutex< T >.
|
inlineoverridevirtual |
Returns the count of threads that currently own a shared lock access to the mutex.
Implements fpmas::api::synchro::Mutex< T >.