#include <Mutex.h>
Inheritance diagram for TSE3::Impl::MutexImpl:
Public Member Functions | |
virtual | ~MutexImpl () |
virtual void | lock ()=0 |
virtual void | unlock ()=0 |
virtual bool | locked ()=0 |
This class provides an abtract interface for a mutex implementation.
The NullMutexImpl class inherits from this base class, and provides a 'null' implementation: performing no lock or unlock operations.
This class provides a way of specifying mutex behaviour in a platform independant manner.
If you want to use TSE3 in a thread-safe manner then you will need to implement a MutexImpl class and pass it to the Mutex class.
A MutexImpl is created in an unlocked state.
|
|
|
Locks the mutex. If the mutex implementation is already locked by a different thread, then this thread will block until the previous one unlocks the mutex. A single thread can lock the mutex multiple times. However, subsequent calls to lock have no effect. There must be the same number of calls to unlock before the MutexImpl is unlocked, though.
Implemented in TSE3::Impl::NullMutexImpl. |
|
Unlocks the mutex. To unlock the mutex fully, as many unlocks must be called as locks. If the MutexImpl is already unlocked, then nothing will happen.
Implemented in TSE3::Impl::NullMutexImpl. |
|
Returns true if the MutexImpl is locked, false otherwise.
Implemented in TSE3::Impl::NullMutexImpl. |