rpa::mutex_count< Mutex > Struct Template Reference

Wraps a mutex to count the number of times it is un-/try/-locked. More...

#include <synchro.h>

Inheritance diagram for rpa::mutex_count< Mutex >:

rpa::mutex_count_base List of all members.

Public Member Functions

void lock (void)
 Calls the base class 'count'n a,d increments the counter.
void unlock (void)
 Counter changed before unlocking the mutex of the base class.
bool trylock (void)
 Returns true if lock is busy, or false if could be locked ie was unlocked before.

Detailed Description

template<class Mutex>
struct rpa::mutex_count< Mutex >

Wraps a mutex to count the number of times it is un-/try/-locked.


Member Function Documentation

template<class Mutex>
void rpa::mutex_count< Mutex >::lock ( void   )  [inline]

Calls the base class 'count'n a,d increments the counter.

NOTE: The counters can be checked and changed only when the base mutex is locked. Otherwise, there would be a race condition.

template<class Mutex>
bool rpa::mutex_count< Mutex >::trylock ( void   )  [inline]

Returns true if lock is busy, or false if could be locked ie was unlocked before.

template<class Mutex>
void rpa::mutex_count< Mutex >::unlock ( void   )  [inline]

Counter changed before unlocking the mutex of the base class.


The documentation for this struct was generated from the following file:
Generated on Tue Sep 25 10:20:38 2007 for rpa by  doxygen 1.4.7