# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CUnfairMutex Class Reference

Classic mutex implementation (not necessarly fair) Don't assume the mutex are recursive (ie don't call enter() several times on the same mutex from the same thread without having called leave()) ; and don't assume either the threads are woken-up in the same order as they were put to sleep ! More...

#include <mutex.h>

List of all members.

Public Methods

 CUnfairMutex ()
 Constructor. More...

 CUnfairMutex (const std::string &name)
 ~CUnfairMutex ()
 Destructor. More...

void enter ()
 Enter the critical section. More...

void leave ()
 Leave the critical section. More...


Detailed Description

Classic mutex implementation (not necessarly fair) Don't assume the mutex are recursive (ie don't call enter() several times on the same mutex from the same thread without having called leave()) ; and don't assume either the threads are woken-up in the same order as they were put to sleep !

Windows: uses Mutex, cannot be shared among processes. Linux: uses PThread POSIX Mutex, cannot be shared among processes.

 CUnfairMutex m;
 m.enter ();
 // do critical stuffs
 m.leave ();
 *
Author:
Vianney Lecroart, Olivier Cado , Nevrax France
Date:
2000

Definition at line 77 of file mutex.h.


Constructor & Destructor Documentation

NLMISC::CUnfairMutex::CUnfairMutex  
 

Constructor.

NLMISC::CUnfairMutex::CUnfairMutex const std::string &    name
 

NLMISC::CUnfairMutex::~CUnfairMutex  
 

Destructor.


Member Function Documentation

void NLMISC::CUnfairMutex::enter  
 

Enter the critical section.

void NLMISC::CUnfairMutex::leave  
 

Leave the critical section.


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