SourceForge.net Logo

DAQpp::Mutex Class Reference

class Mutex This class encapsulates a pthread Mutex More...

#include <Thread.h>

Inheritance diagram for DAQpp::Mutex:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Mutex ()
 constructor
 ~Mutex ()
 destructor
void set_debug (bool x)
 Sets the debug flags to the value in the input.
int acquire ()
 Acquire or lock the mutex.
bool busy ()
 Checks whether the mutex is locked or not.
int release ()
 Releases the Mutex.

Protected Attributes

bool debug
 debugflags
pthread_mutex_t _mtx
 the mutex
pthread_t _owner
 the thread that owns the mutex
int _count
 A counter.


Detailed Description

class Mutex This class encapsulates a pthread Mutex

Member Function Documentation

bool Mutex::busy (  ) 

Checks whether the mutex is locked or not.

Returns:
true if the mutex is locked, false otherwise.

References _mtx.

int Mutex::release (  ) 

Releases the Mutex.

Note: This class emulates a recursive mutex. One needs as many calls to release as calls where made to acquire.

Returns:
the number of times this function still needs to be called to really release the Mutex

References _count, _mtx, _owner, and debug.

Referenced by DAQpp::DAQmanager::Acquire(), DAQpp::FileIOManager::close(), DAQpp::Monitor::get_event(), DAQpp::FIFO::read(), DAQpp::Monitor::stop_monitor(), DAQpp::Condition::wait(), DAQpp::FileIOManager::write(), and DAQpp::FIFO::write().


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

Generated on Mon Apr 21 10:00:05 2008 for DAQ++ by  doxygen 1.5.5