Threads::Mutex Class Reference

List of all members.

Classes

class  ScopedLock

Public Member Functions

 Mutex ()
 Mutex (const Mutex &)
void acquire ()
void release ()

Private Attributes

std_cxx1x::mutex mutex

Friends

class ConditionVariable

Detailed Description

Class implementing a Mutex. Mutexes are used to lock data structures to ensure that only a single thread of execution can access them at the same time.

Copy semantics

When copied, the receiving object does not receive any state from the object being copied, i.e. an entirely new mutex is created. This is consistent with expectations if a mutex is used as a member variable to lock the other member variables of a class: in that case, the mutex of the copied-to object should only guard the members of the copied-to object, not the members of both the copied-to and copied-from object.

Author:
Wolfgang Bangerth, 2002, 2003, 2009

Constructor & Destructor Documentation

Threads::Mutex::Mutex (  )  [inline]

Default constructor.

Threads::Mutex::Mutex ( const Mutex  )  [inline]

Copy constructor. As discussed in this class's documentation, no state is copied from the object given as argument.


Member Function Documentation

void Threads::Mutex::acquire (  )  [inline]

Acquire a mutex.

References mutex.

Referenced by Threads::Mutex::ScopedLock::ScopedLock().

void Threads::Mutex::release (  )  [inline]

Release the mutex again.

References mutex.

Referenced by Threads::Mutex::ScopedLock::~ScopedLock().


Friends And Related Function Documentation

friend class ConditionVariable [friend]

Make the class implementing condition variables a friend, since it needs to access the mutex.


Member Data Documentation

std_cxx1x::mutex Threads::Mutex::mutex [private]

Data object storing the mutex data

Referenced by acquire(), release(), and Threads::ConditionVariable::wait().


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

deal.II documentation generated on Mon Nov 23 22:58:34 2009 by doxygen 1.6.1