#include <Local_Tokens.h>
Inheritance diagram for ACE_Tokens:


Public Types | |
| typedef ACE_Unbounded_Stack< ACE_TPQ_Entry * > | OWNER_STACK |
| Stack of owners. More... | |
| enum | TOKEN_TYPES { MUTEX, RWLOCK } |
Public Methods | |
| ACE_Tokens (void) | |
| Null constructor. More... | |
| virtual | ~ACE_Tokens (void) |
| Destructor. More... | |
| virtual int | acquire (ACE_TPQ_Entry *caller, int ignore_deadlock, int notify)=0 |
| No implementation. More... | |
| virtual int | tryacquire (ACE_TPQ_Entry *caller)=0 |
| No implementation. More... | |
| virtual int | renew (ACE_TPQ_Entry *caller, int requeue_position)=0 |
| No implementation. More... | |
| virtual int | release (ACE_TPQ_Entry *caller)=0 |
| No implementation. More... | |
| void | make_owner (ACE_TPQ_Entry *caller) |
| Move the caller to the front of the waiter list. This is for use with remote mutexes and shadow mutexes. More... | |
| void | remove (ACE_TPQ_Entry *caller) |
| Remove the caller from the waiter list. More... | |
| virtual int | owners (OWNER_STACK &o, const ACE_TCHAR *id)=0 |
| Returns a stack of the current owners. Returns -1 on error, 0 on success. If <id> is non-zero, returns 1 if id is an owner. More... | |
| virtual int | is_waiting_for (const ACE_TCHAR *id)=0 |
| Returns 1 if <id> is waiting for this token. 0 otherwise. More... | |
| virtual int | is_owner (const ACE_TCHAR *id)=0 |
| Returns 1 if <id> is an owner of this token. 0 otherwise. More... | |
| virtual ACE_Token_Proxy_Queue * | waiters (void) |
| Return the queue of waiters. More... | |
| virtual int | no_of_waiters (void) |
| Return the number of proxies that are currently waiting to get the token. More... | |
| const ACE_TCHAR * | owner_id (void) |
| The current owner. More... | |
| const ACE_TCHAR * | name (void) |
| Token name. More... | |
| void | inc_reference (void) |
| int | dec_reference (void) |
| void | dump (void) const |
| Dump the state of the class. More... | |
| virtual int | type (void) const=0 |
| void | visit (int v) |
| Mark or unmark the token as visited. More... | |
| int | visited (void) |
| Check if the token has been visited. More... | |
| ACE_TPQ_Entry * | owner (void) |
| All the data of the current owner. More... | |
Protected Attributes | |
| int | visited_ |
| For the deadlock detection algorithm. More... | |
| int | reference_count_ |
| Reference count. More... | |
| ACE_Token_Proxy_Queue | waiters_ |
| List of client's owning and waiting the token. More... | |
| ACE_TCHAR | token_name_ [ACE_MAXTOKENNAMELEN] |
| Name of token. More... | |
Not a public interface. Currently, I don't see a reason for providing an abstract interface at this level of the library. As of yet, no one uses <ACE_Tokens> derivatives through this abstract interface except for <ACE_Token_Manager>. It only uses the statistical methods which are shared by all Tokens. For that reason, it still makes since to have a common base class. However, acquire, renew, and release do not need to have matching interfaces throughout all Tokens. To add a new type of token (e.g. semaphore), this class must be subtyped to define the new semantics. See <ACE_Token_Manager> for details.
Definition at line 366 of file Local_Tokens.h.
|
|
Stack of owners.
Definition at line 401 of file Local_Tokens.h. Referenced by ACE_Token_Manager::check_deadlock. |
|
|
These are the Token types supported by the library at ship time. There is no restriction on the number of Token types added by "3rd parties." These are only necessary for the Token Server. Definition at line 439 of file Local_Tokens.h.
|
|
|
Null constructor.
Definition at line 32 of file Local_Tokens.cpp. References ACE_TRACE.
00033 : visited_ (0), 00034 reference_count_ (0) 00035 { 00036 ACE_TRACE ("ACE_Tokens::ACE_Tokens"); 00037 } |
|
|
Destructor.
|
|
||||||||||||||||
|
No implementation.
Implemented in ACE_Mutex_Token. Referenced by ACE_Token_Proxy::acquire. |
|
|
Referenced by ACE_Token_Manager::release_token. |
|
|
Dump the state of the class.
Reimplemented in ACE_Mutex_Token. Definition at line 19 of file Local_Tokens.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, ACE_Token_Proxy_Queue::dump, LM_DEBUG, reference_count_, token_name_, and waiters_. Referenced by ACE_Token_Proxy::dump, ACE_RW_Token::dump, and ACE_Mutex_Token::dump.
00020 {
00021 ACE_TRACE ("ACE_Tokens::dump");
00022 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00023 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("ACE_Tokens::dump:\n")
00024 ACE_LIB_TEXT (" reference_cont_ = %d\n")
00025 ACE_LIB_TEXT (" token_name_ = %s\n"),
00026 reference_count_, token_name_));
00027 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("waiters_\n")));
00028 this->waiters_.dump ();
00029 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00030 }
|
|
|
Referenced by ACE_Token_Manager::get_token. |
|
|
Returns 1 if <id> is an owner of this token. 0 otherwise.
Implemented in ACE_Mutex_Token. |
|
|
Returns 1 if <id> is waiting for this token. 0 otherwise.
Implemented in ACE_Mutex_Token. Referenced by ACE_Token_Manager::token_waiting_for. |
|
|
Move the caller to the front of the waiter list. This is for use with remote mutexes and shadow mutexes.
Definition at line 40 of file Local_Tokens.cpp. References ACE_Token_Proxy_Queue::enqueue, ACE_Token_Proxy_Queue::remove, and waiters_. Referenced by ACE_Remote_Token_Proxy::acquire, and ACE_Remote_Token_Proxy::renew.
|
|
|
Token name.
Referenced by ACE_Mutex_Token::ACE_Mutex_Token, ACE_RW_Token::ACE_RW_Token, ACE_Token_Manager::check_deadlock, ACE_Token_Proxy::name, and ACE_Token_Manager::release_token. |
|
|
Return the number of proxies that are currently waiting to get the token.
Referenced by ACE_Token_Proxy::acquire. |
|
|
|
The current owner.
Referenced by ACE_Token_Proxy::acquire, ACE_Token_Proxy::owner_id, ACE_Token_Proxy::release, and ACE_Token_Proxy::renew. |
|
||||||||||||
|
Returns a stack of the current owners. Returns -1 on error, 0 on success. If <id> is non-zero, returns 1 if id is an owner.
Implemented in ACE_Mutex_Token. Referenced by ACE_Token_Manager::check_deadlock. |
|
|
No implementation.
Implemented in ACE_Mutex_Token. Referenced by ACE_Token_Proxy::release. |
|
|
Remove the caller from the waiter list.
Referenced by ACE_Token_Proxy::release, ACE_RW_Token::release, ACE_Mutex_Token::release, and ACE_RW_Token::renew. |
|
||||||||||||
|
No implementation.
Implemented in ACE_Mutex_Token. Referenced by ACE_Token_Proxy::renew. |
|
|
No implementation.
Implemented in ACE_Mutex_Token. Referenced by ACE_Token_Proxy::tryacquire. |
|
|
Provides a manual RTTI mechanism. This method is used only by ACE_Token_Request so that the type of a token can be sent to a remote Token Server. Implemented in ACE_Mutex_Token. Referenced by ACE_Remote_Token_Proxy::acquire, ACE_Token_Invariant_Manager::acquired, ACE_Remote_Token_Proxy::release, ACE_Token_Manager::release_token, ACE_Token_Invariant_Manager::releasing, ACE_Remote_Token_Proxy::renew, and ACE_Remote_Token_Proxy::tryacquire. |
|
|
Mark or unmark the token as visited.
Referenced by ACE_Token_Manager::check_deadlock. |
|
|
Check if the token has been visited.
Referenced by ACE_Token_Manager::check_deadlock. |
|
|
Return the queue of waiters.
|
|
|
Reference count.
Definition at line 466 of file Local_Tokens.h. Referenced by dump. |
|
|
Name of token.
Definition at line 472 of file Local_Tokens.h. Referenced by dump. |
|
|
For the deadlock detection algorithm.
Definition at line 463 of file Local_Tokens.h. |
|
|
List of client's owning and waiting the token.
Definition at line 469 of file Local_Tokens.h. Referenced by ACE_RW_Token::acquire, ACE_Mutex_Token::acquire, dump, ACE_RW_Token::is_owner, ACE_RW_Token::is_waiting_for, ACE_Mutex_Token::is_waiting_for, make_owner, ACE_RW_Token::notify_new_owner, ACE_RW_Token::owners, ACE_Mutex_Token::release, ACE_RW_Token::renew, ACE_Mutex_Token::renew, ACE_RW_Token::tryacquire, and ACE_Mutex_Token::tryacquire. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002