fpmas 1.6
Public Member Functions | List of all members
fpmas::synchro::ghost::GhostMutex< T > Class Template Reference

#include <ghost_mode.h>

Inheritance diagram for fpmas::synchro::ghost::GhostMutex< T >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::synchro::ghost::GhostMutex< T >:
Collaboration graph
[legend]

Public Member Functions

const T & read () override
 
void releaseRead () override
 
T & acquire () override
 
void releaseAcquire () override
 
void synchronize () override
 
- Public Member Functions inherited from fpmas::synchro::ghost::SingleThreadMutex< T >
 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
 

Detailed Description

template<typename T>
class fpmas::synchro::ghost::GhostMutex< T >

GhostMode Mutex implementation.

read() and acquire() methods return a reference to the local data.

See also
fpmas::synchro::GhostMode

Member Function Documentation

◆ read()

template<typename T >
const T & fpmas::synchro::ghost::GhostMutex< T >::read ( )
inlineoverridevirtual

Provides a read access to the internal data.

The functions blocks until data is effectively read.

Read data must be released using releaseRead().

Returns
reference to read data

Implements fpmas::api::synchro::Mutex< T >.

◆ releaseRead()

template<typename T >
void fpmas::synchro::ghost::GhostMutex< T >::releaseRead ( )
inlineoverridevirtual

Releases a mutex previously accessed with read().

Implements fpmas::api::synchro::Mutex< T >.

◆ acquire()

template<typename T >
T & fpmas::synchro::ghost::GhostMutex< T >::acquire ( )
inlineoverridevirtual

Acquires an exclusive access to the internal data.

The function blocks until data is effectively acquired.

Write operations are semantically allowed on acquired data. However, how write operations are handled is implementation defined.

Acquired data must be released using releaseAcquire().

Returns
reference to acquired data

Implements fpmas::api::synchro::Mutex< T >.

◆ releaseAcquire()

template<typename T >
void fpmas::synchro::ghost::GhostMutex< T >::releaseAcquire ( )
inlineoverridevirtual

Releases a mutex previously accessed with acquire().

Semantically, this operation also "commits" eventual write operations that were performed on the acquired data. However, the actual behavior is implementation defined.

Implements fpmas::api::synchro::Mutex< T >.

◆ synchronize()

template<typename T >
void fpmas::synchro::ghost::GhostMutex< T >::synchronize ( )
inlineoverridevirtual

Method eventually called when data synchronization is performed on this Mutex.

The behavior of this method depends on the currently implemented SynchronizationMode.

Implements fpmas::api::synchro::Mutex< T >.


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