ACE
6.1.6
|
Class that acquires, renews, and releases a readers lock that is local to the process. More...
#include <Local_Tokens.h>
Public Member Functions | |
ACE_Local_RLock (const ACE_TCHAR *token_name=0, int ignore_deadlock=0, int debug=0) | |
~ACE_Local_RLock (void) | |
Destructor. | |
void | dump (void) const |
Dump the state of the class. | |
virtual int | type (void) const |
Returns ACE_RW_Token::RLOCK. | |
virtual ACE_Token_Proxy * | clone (void) const |
Return deep copy. | |
![]() | |
ACE_Token_Proxy (void) | |
Construction. | |
virtual | ~ACE_Token_Proxy (void) |
Destructor. | |
virtual int | open (const ACE_TCHAR *name, int ignore_deadlock=0, int debug=0) |
virtual int | acquire (int notify=0, void(*sleep_hook)(void *)=0, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
virtual int | renew (int requeue_position=-1, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
Calls renew on the token. Blocks the calling thread if would block. | |
virtual int | tryacquire (void(*sleep_hook)(void *)=0) |
Calls renew on the token. | |
virtual int | release (ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
Calls release on the token. | |
virtual int | remove (ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
Calls remove on the token. | |
virtual int | acquire_read (int notify=0, void(*sleep_hook)(void *)=0, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
virtual int | acquire_write (int notify=0, void(*sleep_hook)(void *)=0, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
virtual int | tryacquire_read (void(*sleep_hook)(void *)=0) |
virtual int | tryacquire_write (void(*sleep_hook)(void *)=0) |
virtual const ACE_TCHAR * | client_id (void) const |
virtual void | client_id (const ACE_TCHAR *client_id) |
virtual const ACE_TCHAR * | name (void) const |
virtual void | sleep_hook (void) |
virtual void | token_acquired (ACE_TPQ_Entry *) |
virtual const ACE_TCHAR * | owner_id (void) |
The client id of the current token holder. |
Protected Member Functions | |
virtual ACE_Tokens * | create_token (const ACE_TCHAR *name) |
Return a new ACE_Local_Mutex. | |
![]() | |
ACE_Token_Proxy (const ACE_Token_Proxy &) | |
Duplication. | |
int | handle_options (ACE_Synch_Options &options, ACE_TOKEN_CONST::COND_VAR &cv) |
Handles cond_var waits. |
Additional Inherited Members | |
![]() | |
int | ignore_deadlock_ |
If this is set, we ignore deadlock. | |
int | debug_ |
Print a bunch of debug messages. | |
ACE_Tokens * | token_ |
ACE_TSS_TPQ_Entry | waiter_ |
Waiter info used for asynchronous transactions. |
Class that acquires, renews, and releases a readers lock that is local to the process.
This class implements the reader interface to canonical readers/writer locks. Multiple readers can hold the lock simultaneously when no writers have the lock. Alternatively, when a writer holds the lock, no other participants (readers or writers) may hold the lock. This class is a more general-purpose synchronization mechanism than SunOS 5.x RLocks. For example, it implements "recursive RLock" semantics, where a thread that owns the token can reacquire it without deadlocking. In addition, threads that are blocked awaiting the token are serviced in strict FIFO order as other threads release the token (SunOS 5.x RLockes don't strictly enforce an acquisition order). The interfaces for acquire, tryacquire, renew, release, etc. are defined in ACE_Token_Proxy. The semantics for ACE_Local_RLock are that of a readers/writers lock. Acquire for this class implies a reader acquisition. That is, multiple clients may acquire a lock for read only.
|
inline |
Constructor.
token_name | Uniquely id's the token. |
ignore_deadlock | Will allow deadlock to occur (useful for testing). |
debug | Prints a bunch of messages. |
ACE_Local_RLock::~ACE_Local_RLock | ( | void | ) |
Destructor.
|
virtual |
Return deep copy.
Implements ACE_Token_Proxy.
|
protectedvirtual |
Return a new ACE_Local_Mutex.
Implements ACE_Token_Proxy.
void ACE_Local_RLock::dump | ( | void | ) | const |
Dump the state of the class.
Reimplemented from ACE_Token_Proxy.
|
virtual |
Returns ACE_RW_Token::RLOCK.
Reimplemented from ACE_Token_Proxy.