ACE_Mutex
wrapper (valid in same process or across processes (depending on TYPE flag)). In general, however, we recommend using ACE_Process_Mutex or ACE_Thread_Mutex rather than ACE_Mutex.
More...
#include <Mutex.h>
ACE_Mutex
wrapper (valid in same process or across processes (depending on TYPE flag)). In general, however, we recommend using ACE_Process_Mutex or ACE_Thread_Mutex rather than ACE_Mutex.
ACE_Mutex::~ACE_Mutex |
( |
void |
| ) |
|
Implicitly destroy the mutex.
int ACE_Mutex::acquire |
( |
void |
| ) |
|
|
inline |
Acquire lock ownership (wait on queue if necessary).
Block the thread until the mutex is acquired or tv times out, in which case -1 is returned and errno
== ETIME
.
- Note
- 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
. 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
- *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.
int ACE_Mutex::acquire_read |
( |
void |
| ) |
|
|
inline |
Acquire mutex ownership.
This calls acquire
and is only here to make the ACE_Mutex
interface consistent with the other synchronization APIs.
int ACE_Mutex::acquire_write |
( |
void |
| ) |
|
|
inline |
Acquire mutex ownership.
This calls acquire
and is only here to make the ACE_Mutex
interface consistent with the other synchronization APIs.
void ACE_Mutex::dump |
( |
void |
| ) |
const |
Dump the state of an object.
const ACE_mutex_t & ACE_Mutex::lock |
( |
void |
| ) |
const |
|
inline |
Return the underlying mutex.
ACE_mutex_t & ACE_Mutex::lock |
( |
void |
| ) |
|
|
inline |
void ACE_Mutex::operator= |
( |
const ACE_Mutex & |
| ) |
|
|
private |
int ACE_Mutex::release |
( |
void |
| ) |
|
|
inline |
Release lock and unblock a thread at head of queue.
int ACE_Mutex::remove |
( |
void |
| ) |
|
|
inline |
Explicitly destroy the mutex.
- Note
- Only one thread should call this method since it doesn't protect against race conditions.
int ACE_Mutex::tryacquire |
( |
void |
| ) |
|
|
inline |
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
.
int ACE_Mutex::tryacquire_read |
( |
void |
| ) |
|
|
inline |
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
.
int ACE_Mutex::tryacquire_write |
( |
void |
| ) |
|
|
inline |
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
.
int ACE_Mutex::tryacquire_write_upgrade |
( |
void |
| ) |
|
|
inline |
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.
ACE_Mutex::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
ACE_mutex_t ACE_Mutex::lock_ |
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.
The documentation for this class was generated from the following files: