UCommon
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
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.
void lock (void)
 Acquire or increase locking.
bool lock (timeout_t timeout)
 Timed lock request.
 RecursiveMutex ()
 Create rexlock.
void release (void)
 Release or decrease locking.
- Public Member Functions inherited from ucommon::ExclusiveProtocol
virtual void Exlock (void)=0
 Protocol interface to exclusive lock the object.
void Lock (void)
 A convenience member function for accessing the exclusive lock.
virtual void Unlock (void)=0
 Protocol interface to release a lock.

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)
void Unlock (void)

Protected Attributes

pthread_t locker
unsigned lockers
unsigned waiting

Additional Inherited Members

- Static Private Member Functions inherited from ucommon::Conditional
static void gettimeout (timeout_t timeout, struct timespec *hires)
 Convert a millisecond timeout into use for high resolution conditional timers.
static pthread_condattr_t * initializer (void)
 Support function for getting conditional attributes for realtime scheduling.

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)
inlinestatic

Convenience method to lock a recursive lock.

Parameters
rexlock 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)
inlinestatic

Convenience method to unlock a recursive lock.

Parameters
rexlock 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: