Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more::cf::mutex Struct Reference

Mutual exclusive lock. More...

#include <thread.h>

Inheritance diagram for more::cf::mutex:

Inheritance graph
[legend]
Collaboration diagram for more::cf::mutex:

Collaboration graph
[legend]
List of all members.

Public Methods

Friends


Detailed Description

Mutual exclusive lock.

Mutex locks are used to prevent different threads from accessing the same collection of interdependent data simultaneously. If the conditions given for the member functions are violated, a logic_error will be thrown. Also, runtime_error may be throw in case of lack of resources.


Constructor & Destructor Documentation

more::cf::mutex::mutex  
 

The non-trivial default ctor initializes a new mutex.

more::cf::mutex::mutex mutex const &   
 

Copy ctor with shallow-copy semantic.

more::cf::mutex::~mutex  
 

Destructor.

The destructor requires that the mutex is currently unlocked.


Member Function Documentation

void more::cf::mutex::lock  
 

Lock the mutex.

The mutex must not be already locked in the same thread. If it is locked by another thread, this call will suspend the current thread until it is unlocked.

mutex& more::cf::mutex::operator= mutex const &   
 

Assignment with shallow-copy semantic.

bool more::cf::mutex::trylock  
 

Lock the mutex if it is unlocked.

Same as lock(), except that when the mutex is locked by another thread, this call exits with false. Otherwise it exits with true.

void more::cf::mutex::unlock  
 

Unlock a mutex.


Friends And Related Function Documentation

friend class mutex_data [friend]
 


The documentation for this struct was generated from the following file:
Generated on Sat Sep 7 19:12:01 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.