regina::NMutex Class Reference
[Utilities]

A mutual exclusion device (mutex) used to ensure that different threads do not interfere when working with the same data. More...

#include <nthread.h>

Inheritance diagram for regina::NMutex:

regina::NProgress regina::NProgressFinished regina::NProgressMessage regina::NProgressNumber

List of all members.

Classes

class  MutexLock
 A utility class for locking and unlocking a mutex. More...

Public Member Functions

 NMutex ()
 Creates a new mutex.
 ~NMutex ()
 Destroys this mutex.


Detailed Description

A mutual exclusion device (mutex) used to ensure that different threads do not interfere when working with the same data.

A mutex can be either locked or unlocked, and can only be locked by one thread at a time. If a second thread tries to lock the mutex, it will be suspended until the mutex is unlocked by the original locking thread.

A mutex is locked by declaring a local variable of type NMutex::MutexLock. See the NMutex::MutexLock class notes for details.

Classes can inherit from NMutex to provide mutex protection for their internal data; it is recommended that such inheritance be protected and that the member functions alone take full responsibility for locking and unlocking the mutex when appropriate. Alternatively, a standalone NMutex object can be passed about between routines.

Python:
Not present.

Constructor & Destructor Documentation

regina::NMutex::NMutex (  )  [inline]

Creates a new mutex.

The mutex will be created unlocked.

regina::NMutex::~NMutex (  )  [inline]

Destroys this mutex.

Precondition:
This mutex is unlocked.


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

Copyright © 1999-2009, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).