#include <Recursive_Thread_Mutex.h>
Collaboration diagram for ACE_Recursive_Thread_Mutex:
Public Methods | |
ACE_Recursive_Thread_Mutex (const ACE_TCHAR *name=0, ACE_mutexattr_t *arg=0) | |
Initialize a recursive mutex. | |
~ACE_Recursive_Thread_Mutex (void) | |
Implicitly release a recursive mutex. | |
int | remove (void) |
int | acquire (void) |
int | tryacquire (void) |
int | acquire_read (void) |
int | acquire_write (void) |
int | tryacquire_read (void) |
int | tryacquire_write (void) |
int | tryacquire_write_upgrade (void) |
int | release (void) |
ACE_thread_t | get_thread_id (void) |
Return the id of the thread that currently owns the mutex. | |
int | get_nesting_level (void) |
ACE_recursive_thread_mutex_t & | mutex (void) |
Returns a reference to the recursive mutex;. | |
ACE_thread_mutex_t & | get_nesting_mutex (void) |
Returns a reference to the recursive mutex's internal mutex;. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Protected Methods | |
void | set_thread_id (ACE_thread_t t) |
Protected Attributes | |
ACE_recursive_thread_mutex_t | lock_ |
Recursive mutex. | |
int | removed_ |
Private Methods | |
void | operator= (const ACE_Recursive_Thread_Mutex &) |
ACE_Recursive_Thread_Mutex (const ACE_Recursive_Thread_Mutex &) |
|
Initialize a recursive mutex.
|
|
Implicitly release a recursive mutex.
|
|
|
|
Acquire a recursive mutex (will increment the nesting level and not deadmutex if the owner of the mutex calls this method more than once). |
|
Acquire mutex ownership. This calls <acquire> and is only here to make the <ACE_Recusive_Thread_Mutex> interface consistent with the other synchronization APIs. |
|
Acquire mutex ownership. This calls <acquire> and is only here to make the <ACE_Recusive_Thread_Mutex> interface consistent with the other synchronization APIs. |
|
Dump the state of an object.
|
|
Return the nesting level of the recursion. When a thread has acquired the mutex for the first time, the nesting level == 1. The nesting level is incremented every time the thread acquires the mutex recursively. |
|
Returns a reference to the recursive mutex's internal mutex;.
|
|
Return the id of the thread that currently owns the mutex.
|
|
Returns a reference to the recursive mutex;.
|
|
|
|
Releases a recursive mutex (will not release mutex until all the nesting level drops to 0, which means the mutex is no longer held). |
|
Implicitly release a recursive mutex. Note that only one thread should call this method since it doesn't protect against race conditions. |
|
|
|
Conditionally acquire a recursive mutex (i.e., won't block). Returns -1 on failure. If we "failed" because someone else already had the lock, <errno> is set to <EBUSY>. |
|
Conditionally acquire mutex (i.e., won't block). This calls <tryacquire> and is only here to make the <ACE_Recusive_Thread_Mutex> interface consistent with the other synchronization APIs. Returns -1 on failure. If we "failed" because someone else already had the lock, <errno> is set to <EBUSY>. |
|
Conditionally acquire mutex (i.e., won't block). This calls <tryacquire> and is only here to make the <ACE_Recusive_Thread_Mutex> interface consistent with the other synchronization APIs. Returns -1 on failure. If we "failed" because someone else already had the lock, <errno> is set to <EBUSY>. |
|
This is only here to make the <ACE_Recursive_Thread_Mutex> interface consistent with the other synchronization APIs. Assumes the caller has already acquired the mutex using one of the above calls, and returns 0 (success) always. |
|
Declare the dynamic allocation hooks.
|
|
Recursive mutex.
|
|
Keeps track of whether <remove> has been called yet to avoid multiple <remove> calls, e.g., explicitly and implicitly in the destructor. This flag isn't protected by a lock, so make sure that you don't have multiple threads simultaneously calling <remove> on the same object, which is a bad idea anyway... |