RR Thread Pool
 All Classes Functions Typedefs Groups Pages
Public Types | Public Member Functions | Friends | List of all members
Mutex Class Reference

Convenient adapter for class IMutex. More...

#include <Mutex.h>

Public Types

typedef Locker< MutexLocker
 Convenient typedef for a Locker that locks a Mutex.
 

Public Member Functions

 Mutex ()
 Default constructor. More...
 
 Mutex (IMutex *imutex)
 Creates a mutex adapter from out of an abstract interface. More...
 
void lock ()
 Locks the mutex. More...
 
void unlock ()
 Unlocks the mutex. More...
 
IMutexinterface ()
 Returns the abstract interface used by the adapter.
 

Friends

class CondPosix
 
class Cond
 

Detailed Description

Convenient adapter for class IMutex.

See Also
Resource Acquisition Is Initialization
Mutex my_mutex;
...
// Exception safe critical section:
{
Mutex::Locker( my_mutex );
...
}
...

Constructor & Destructor Documentation

Mutex::Mutex ( )
inline

Default constructor.

Builds a mutex calling the method IMutex::create() and hosting the returned abstract interface.

Mutex::Mutex ( IMutex imutex)
inline

Creates a mutex adapter from out of an abstract interface.

Parameters
imutexObject implementing the abstract interface IMutex.
Precondition
  1. Parameter imutex is not null.

Member Function Documentation

void Mutex::lock ( )
inline

Locks the mutex.

The calling thread try to get the exclusive ownership over the mutex or wait until it manage to

void Mutex::unlock ( )
inline

Unlocks the mutex.


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