#include <Remote_Tokens.h>
Inheritance diagram for ACE_Remote_Token_Proxy:
Public Methods | |
ACE_Remote_Token_Proxy (void) | |
Null construction. | |
virtual | ~ACE_Remote_Token_Proxy (void) |
Death. | |
int | open (const ACE_TCHAR *name, int ignore_deadlock=0, int debug=0) |
int | initiate_connection (void) |
virtual int | acquire (int notify=0, void(*sleep_hook)(void *)=0, ACE_Synch_Options &options=ACE_Synch_Options::synch) |
virtual int | tryacquire (void(*sleep_hook)(void *)=0) |
virtual int | renew (int requeue_position=0, ACE_Synch_Options &options=ACE_Synch_Options::synch) |
virtual int | release (ACE_Synch_Options &options=ACE_Synch_Options::synch) |
virtual int | remove (ACE_Synch_Options &options=ACE_Synch_Options::synch) |
virtual void | token_acquired (ACE_TPQ_Entry *) |
Override the default to do nothing. | |
virtual const ACE_TCHAR * | owner_id (void) |
The client id of the current token holder. | |
void | dump (void) const |
Dump the state of the class. | |
Static Public Methods | |
void | set_server_address (const ACE_INET_Addr &server_address) |
Protected Methods | |
int | request_reply (ACE_Token_Request &request, ACE_Synch_Options &options) |
Perform the request and wait for the reply. | |
Protected Attributes | |
int | ignore_shadow_deadlock_ |
If shadows report deadlock, go remote anyway. |
The Remote_Token_Proxy class implements the mechanisms for distributed token operations. It is similar to the ACE_Token_Proxy. = BUGS Distributed sleep_hooks have not been implemented. <owner_id> is not implemented.
|
Null construction.
|
|
Death.
|
|
Acquire the distributed token. If notify is specified and the token is already held, the owner is notified. options contains the timeout value for the acquire call. The timer is kept at the token server. Asynchronous operations are not supported. Returns 0 on success, -1 on failure with <errno> == problem. Reimplemented from ACE_Token_Proxy. |
|
Dump the state of the class.
Reimplemented from ACE_Token_Proxy. Reimplemented in ACE_Remote_Mutex, ACE_Remote_RLock, and ACE_Remote_WLock. |
|
Open a connection with the token server. This only need be used when the user wishes to explicitly open a connection to check if the server exists. Connections are stored in the ACE_Token_Connections singleton as thread-specific data. That is, every thread has only one connection that is used for all remote tokens. |
|
Same as Token_Proxy. <name> is the string uniquely identifying the token. <ignore_deadlock> can be 1 to disable deadlock notifications. <debug> prints debug messages. Reimplemented from ACE_Token_Proxy. |
|
The client id of the current token holder.
Reimplemented from ACE_Token_Proxy. |
|
Release the distributed token. Similar to ACE_Local_Mutex, if the caller is not the owner, it is removed from the waiter list (if applicable.) Returns 0 on success, -1 on failure with <errno> == problem. Reimplemented from ACE_Token_Proxy. |
|
Become interface compliant for ACE_Guard<>. This has no functionality. Reimplemented from ACE_Token_Proxy. |
|
Renew the token by offering to release it if there are any other waiters, otherwise get the token back immediately. This renew has the same semantics as ACE_Local_Mutex release. It is semantically equivalent to <release> followed by <acquire>, but it is faster. options contains the timeout value used if renew blocks. As with acquire, the timer is maintained at the token server. If there are waiters and requeue_position == -1, the caller is queued at the rear of the waiter list. Otherwise, requeue_position specifies the number of waiters to "let by" before reacquiring the token (effectively, the position in the waiter list.) Reimplemented from ACE_Token_Proxy. |
|
Perform the request and wait for the reply.
|
|
Sets the server address for all instances of ACE_Remote_Token_Proxy If this isn't called, the environment variable TOKEN_SERVER is checked for the server address. If that is not specified, all ACE_Remote_** operations will fail. |
|
Override the default to do nothing.
Reimplemented from ACE_Token_Proxy. |
|
Try to acquire the distributed token. If the token is already held, the call returns without queueing the caller as a waiter. Returns 0 on success (the token was acquired), and -1 with EWOULDBLOCK if the token was already held. Reimplemented from ACE_Token_Proxy. |
|
If shadows report deadlock, go remote anyway.
|