GNE::Mutex Class Reference
[Threading API]

The mutex class models a simple mutex to provide mutual exclusion to a resource shared by threads. More...

#include <Mutex.h>

List of all members.

Classes

struct  MutexData

Public Member Functions

 Mutex ()
 Initializes this mutex.
void acquire ()
 Acquire the lock on a mutex, blocking if necessary.
void release ()
 Releases a locked mutex.

Friends

class Thread
class ConditionVariable

Detailed Description

The mutex class models a simple mutex to provide mutual exclusion to a resource shared by threads.

This version of a mutex is recursive. This means that if a thread already owns the mutex, then a second lock will not deadlock. You need to unlock the mutex the same number of times it was locked to unlock it.


Member Function Documentation

void GNE::Mutex::acquire (  ) 

Acquire the lock on a mutex, blocking if necessary.

  1. If the mutex is unlocked, lock it, and proceed.
  2. If the mutex is locked, wait for it to become unlocked, then go to step 1.

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

Generated on Thu Dec 24 19:04:10 2009 for GNE by  doxygen 1.6.1