ACE
6.1.2
|
Wrapper for readers/writer locks that exist across processes. More...
#include <RW_Process_Mutex.h>
Public Member Functions | |
ACE_RW_Process_Mutex (const ACE_TCHAR *name=0, int flags=O_CREAT|O_RDWR, mode_t mode=ACE_DEFAULT_RW_PROCESS_MUTEX_PERMS) | |
~ACE_RW_Process_Mutex (void) | |
int | remove (void) |
int | acquire (void) |
int | tryacquire (void) |
int | release (void) |
Release lock. | |
int | acquire_read (void) |
int | acquire_write (void) |
int | tryacquire_read (void) |
int | tryacquire_write (void) |
int | tryacquire_write_upgrade (void) |
const ACE_File_Lock & | lock (void) const |
Return the underlying lock. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Member Functions | |
const ACE_TCHAR * | unique_name (void) |
Create and return the unique name. | |
Private Attributes | |
ACE_TCHAR | name_ [ACE_UNIQUE_NAME_LEN] |
ACE_File_Lock | lock_ |
We need this to get the readers/writer semantics... |
Wrapper for readers/writer locks that exist across processes.
ACE_RW_Process_Mutex::ACE_RW_Process_Mutex | ( | const ACE_TCHAR * | name = 0 , |
int | flags = O_CREAT|O_RDWR , |
||
mode_t | mode = ACE_DEFAULT_RW_PROCESS_MUTEX_PERMS |
||
) |
Create a cross-process readers/writer mutex, passing in the optional name, flags and mode
|
inline |
Same as acquire_write(). Acquire lock ownership; blocks until the lock is acquired or the operation fails.
|
inline |
Acquire read lock; blocks until the lock is acquired or the operation fails.
|
inline |
Acquire write lock; blocks until the lock is acquired or the operation fails.
void ACE_RW_Process_Mutex::dump | ( | void | ) | const |
Dump the state of an object.
|
inline |
Return the underlying lock.
|
inline |
Release lock.
|
inline |
Explicitly destroy the mutex. Note that only one thread should call this method since it doesn't protect against race conditions.
|
inline |
Same as tryacquire_write(). Try to acquire the lock, but do not block if the lock is not immediately acquired.
-1 | on failure. If the lock is already held, errno is set to EBUSY . |
|
inline |
Try to acquire the read lock, but do not block if the lock is not immediately acquired.
-1 | on failure. If the lock is already held, errno is set to EBUSY . |
|
inline |
Try to acquire the write lock, but do not block if the lock is not immediately acquired.
-1 | on failure. If the lock is already held, errno is set to EBUSY . |
|
inline |
Attempt to upgrade a read lock to a write lock. Returns 0 on success, -1 on failure.
|
private |
Create and return the unique name.
Declare the dynamic allocation hooks.
We need this to get the readers/writer semantics...
If the user does not provide a name we generate a unique name in this buffer.