#include <Synch.h>
Public Methods | |
| ACE_Mutex (int type=USYNC_THREAD, const ACE_TCHAR *name=0, ACE_mutexattr_t *arg=0, mode_t mode=ACE_DEFAULT_FILE_PERMS) | |
| Initialize the mutex. More... | |
| ~ACE_Mutex (void) | |
| Implicitly destroy the mutex. More... | |
| int | remove (void) |
| Explicitly destroy the mutex. More... | |
| int | acquire (void) |
| Acquire lock ownership (wait on queue if necessary). More... | |
| int | acquire (ACE_Time_Value &tv) |
| Block the thread until the mutex is acquired or <tv> times out, in which case -1 is returned and <errno> == <ETIME>. More... | |
| int | acquire (ACE_Time_Value *tv) |
| If <tv> == 0 then call <acquire()> directly. More... | |
| int | tryacquire (void) |
| Conditionally acquire lock (i.e., don't wait on queue). More... | |
| int | release (void) |
| Release lock and unblock a thread at head of queue. More... | |
| int | acquire_read (void) |
| Acquire mutex ownership. More... | |
| int | acquire_write (void) |
| Acquire mutex ownership. More... | |
| int | tryacquire_read (void) |
| Conditionally acquire mutex (i.e., won't block). More... | |
| int | tryacquire_write (void) |
| Conditionally acquire mutex (i.e., won't block). More... | |
| int | tryacquire_write_upgrade (void) |
| This is only here for consistency with the other synchronization APIs and usability with Lock adapters. More... | |
| const ACE_mutex_t & | lock (void) const |
| Return the underlying mutex. More... | |
| void | dump (void) const |
| Dump the state of an object. More... | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. More... | |
| ACE_mutex_t | lock_ |
| Mutex type supported by the OS. More... | |
| int | removed_ |
| 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... More... | |
Private Methods | |
| void | operator= (const ACE_Mutex &) |
| ACE_Mutex (const ACE_Mutex &) | |
|
||||||||||||||||||||
|
Initialize the mutex.
|
|
|
Implicitly destroy the mutex.
|
|
|
|
|
|
If <tv> == 0 then call <acquire()> directly. Otherwise, block the thread until the mutex is acquired or <tv> times out, in which case -1 is returned and <errno> == <ETIME>. Note that <*tv> is assumed to be in "absolute" rather than "relative" time. The value of <*tv> is updated upon return to show the actual (absolute) acquisition time. |
|
|
Block the thread until the mutex is acquired or <tv> times out, in which case -1 is returned and <errno> == <ETIME>. Note that <tv> is assumed to be in "absolute" rather than "relative" time. The value of <tv> is updated upon return to show the actual (absolute) acquisition time. |
|
|
Acquire lock ownership (wait on queue if necessary).
|
|
|
Acquire mutex ownership. This calls <acquire> and is only here to make the <ACE_Mutex> interface consistent with the other synchronization APIs. |
|
|
Acquire mutex ownership. This calls <acquire> and is only here to make the <ACE_Mutex> interface consistent with the other synchronization APIs. |
|
|
Dump the state of an object.
|
|
|
Return the underlying mutex.
|
|
|
|
|
|
Release lock and unblock a thread at head of queue.
|
|
|
Explicitly destroy the mutex. Note that only one thread should call this method since it doesn't protect against race conditions. |
|
|
Conditionally acquire lock (i.e., don't wait on queue). 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_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_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 for consistency with the other synchronization APIs and usability with Lock adapters. Assumes the caller already has acquired the mutex and returns 0 in all cases. |
|
|
Declare the dynamic allocation hooks.
|
|
|
Mutex type supported by the OS.
|
|
|
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...
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001