ucommon::RecursiveMutex Class Reference

Portable recursive exclusive lock. More...

#include <thread.h>

Inheritance diagram for ucommon::RecursiveMutex:
Inheritance graph
[legend]
Collaboration diagram for ucommon::RecursiveMutex:
Collaboration graph
[legend]

Public Member Functions

unsigned getLocking (void)
 Get the number of recursive locking levels.
unsigned getWaiting (void)
 Get the number of threads waiting on lock.
bool lock (timeout_t timeout)
 Timed lock request.
void lock (void)
 Acquire or increase locking.
 RecursiveMutex ()
 Create rexlock.
void release (void)
 Release or decrease locking.

Static Public Member Functions

static void lock (RecursiveMutex &rex)
 Convenience method to lock a recursive lock.
static void release (RecursiveMutex &rex)
 Convenience method to unlock a recursive lock.

Protected Member Functions

void Exlock (void)
 Protocol interface to exclusive lock the object.
void Unlock (void)
 Protocol interface to release a lock.

Protected Attributes

pthread_t locker
unsigned lockers
unsigned waiting

Detailed Description

Portable recursive exclusive lock.

This class is built from the conditional and hence does not require support for non-standard and platform specific extensions to pthread mutex to support recrusive style mutex locking. The exclusive protocol is implimented to support exclusive_lock referencing.

Definition at line 477 of file thread.h.


Member Function Documentation

unsigned ucommon::RecursiveMutex::getLocking ( void   ) 

Get the number of recursive locking levels.

Returns:
locking level.
unsigned ucommon::RecursiveMutex::getWaiting ( void   ) 

Get the number of threads waiting on lock.

Returns:
wating thread count.
static void ucommon::RecursiveMutex::lock ( RecursiveMutex rex  )  [inline, static]

Convenience method to lock a recursive lock.

Parameters:
rex lock to lock.

Definition at line 524 of file thread.h.

Here is the call graph for this function:

static void ucommon::RecursiveMutex::release ( RecursiveMutex rex  )  [inline, static]

Convenience method to unlock a recursive lock.

Parameters:
rex lock to release.

Definition at line 531 of file thread.h.

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Thu Jul 14 16:35:20 2011 for ucommon by  doxygen 1.6.3