class MutexImpl

Mutex implementation base class. More...

Contains pure virtuals
Full nameTSE3::Impl::MutexImpl
Definition#include <Mutex.h>
Inherited byNullMutexImpl
List of all Methods
Annotated List

Public Methods

Detailed Description

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.

See also: Mutex

 ~MutexImpl ()



void  lock ()


[pure virtual]

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.

See also: unlock

void  unlock ()


[pure virtual]

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.

See also: lock

bool  locked ()


[pure virtual]

Returns true if the MutexImpl is locked, false otherwise.

See also: lock, unlock