|
| ACE_Token_Collection (bool debug=false, const ACE_TCHAR *name=0) |
|
int | insert (ACE_Token_Proxy &token) |
|
int | extract (const ACE_TCHAR *token_name, ACE_Token_Proxy *&proxy) |
|
ACE_Token_Proxy * | is_member (const ACE_TCHAR *token_name) |
| Returns the proxy if true. 0 otherwise.
|
|
int | is_member (const ACE_Token_Proxy &token) |
|
virtual int | acquire (int notify=0, void(*sleep_hook)(void *)=0, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
|
virtual int | acquire (const ACE_TCHAR *token_name, int notify=0, void(*sleep_hook)(void *)=0, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
|
virtual int | tryacquire (void(*sleep_hook)(void *)=0) |
| Try to acquire all tokens in collection.
|
|
virtual int | tryacquire (const ACE_TCHAR *token_name, void(*sleep_hook)(void *)=0) |
| Try to acquire token_name.
|
|
virtual int | renew (int requeue_position=0, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
|
virtual int | renew (const ACE_TCHAR *token_name, int requeue_position=0, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
|
virtual int | release (ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
|
virtual int | release (const ACE_TCHAR *token_name, ACE_Synch_Options &options=ACE_Synch_Options::defaults) |
|
| ~ACE_Token_Collection () |
|
void | dump () const |
| Dump the state of the class.
|
|
virtual const ACE_TCHAR * | name () const |
|
| ACE_Token_Proxy () |
| Construction.
|
|
virtual | ~ACE_Token_Proxy () |
| Destructor.
|
|
virtual int | open (const ACE_TCHAR *name, int ignore_deadlock=0, int debug=0) |
|
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 () const |
|
virtual void | client_id (const ACE_TCHAR *client_id) |
|
virtual void | sleep_hook () |
|
virtual void | token_acquired (ACE_TPQ_Entry *) |
|
virtual const ACE_TCHAR * | owner_id () |
| The client id of the current token holder.
|
|
void | dump () const |
| Dump the state of the class.
|
|
virtual int | type () const |
|
Allows atomic token group operations AND provides a ACE_Token manager interface.
There are two types of operations offered by ACE_Token_Collection. The first is atomic operations on collections of Token_Proxies. In this respect, the ACE_Token_Collection can be thought of as a single token consisting of multiple Token_Proxies. The second role of the ACE_Token_Collection is as a ACE_Token manager. ACE_Token_Collection allows individual operations on single members of a collection of Token_Proxies. This provides a single access point for operations on multiple tokens.
- Bug
- Although ACE_Token_Collection inherits from ACE_Token_Proxy, it can not be including in a collection. This is because <clone> returns zero for now.
Acquire "atomically" all resources in the collection. This is only successfull if all tokens in the collection could be acquired. options contains the blocking semantics, timeout value, etc. Returns: 0 on success, -1 on failure with errno
== problem. If and error or deadlock occurs for one of the tokens, all the tokens will be released and the method will return -1. Note that returning on detection of deadlock prevents livelock between competing collections. If a collection returns after detecting deadlock, it is the application's responsibility to not to blindly loop on the collection::acquire operation. In other words, once the collection reports deadlock, it is out of our hands.
Reimplemented from ACE_Token_Proxy.