|
reSIProcate/rutil
9694
|
Wraps the recursive mutex implementation on your platform (if there is one). More...
#include <RecursiveMutex.hxx>


Public Member Functions | |
| RecursiveMutex () | |
| virtual | ~RecursiveMutex () |
| virtual void | lock () |
| virtual void | unlock () |
Private Member Functions | |
| pthread_mutex_t * | getId () const |
Private Attributes | |
| pthread_mutexattr_t | mMutexAttr |
| pthread_mutex_t | mId |
Wraps the recursive mutex implementation on your platform (if there is one).
Definition at line 18 of file RecursiveMutex.hxx.
| resip::RecursiveMutex::RecursiveMutex | ( | ) |
Definition at line 68 of file RecursiveMutex.cxx.
References mId, and mMutexAttr.
{
#ifndef WIN32
int rc = pthread_mutexattr_init(&mMutexAttr);
#if defined(__linux__)
pthread_mutexattr_settype(&mMutexAttr, PTHREAD_MUTEX_RECURSIVE_NP);
#else
pthread_mutexattr_settype(&mMutexAttr, PTHREAD_MUTEX_RECURSIVE);
#endif
rc = pthread_mutex_init(&mId, &mMutexAttr);
assert( rc == 0 );
#else
InitializeCriticalSection(&mId);
#endif
}
| resip::RecursiveMutex::~RecursiveMutex | ( | ) | [virtual] |
Definition at line 86 of file RecursiveMutex.cxx.
References mId, and mMutexAttr.
{
#ifndef WIN32
int rc = pthread_mutex_destroy(&mId);
assert( rc != EBUSY ); // currently locked
assert( rc == 0 );
rc = pthread_mutexattr_destroy(&mMutexAttr);
#else
DeleteCriticalSection(&mId);
#endif
}
| pthread_mutex_t * resip::RecursiveMutex::getId | ( | ) | const [private] |
| void resip::RecursiveMutex::lock | ( | ) | [virtual] |
| void resip::RecursiveMutex::unlock | ( | ) | [virtual] |
pthread_mutex_t resip::RecursiveMutex::mId [mutable, private] |
Definition at line 31 of file RecursiveMutex.hxx.
Referenced by getId(), lock(), RecursiveMutex(), unlock(), and ~RecursiveMutex().
pthread_mutexattr_t resip::RecursiveMutex::mMutexAttr [private] |
Definition at line 30 of file RecursiveMutex.hxx.
Referenced by RecursiveMutex(), and ~RecursiveMutex().
1.7.5.1