ACE  6.4.2
Public Member Functions | Protected Member Functions | List of all members
ACE_Local_Mutex Class Reference

Class that acquires, renews, and releases a synchronization token local to the process. More...

#include <Local_Tokens.h>

Inheritance diagram for ACE_Local_Mutex:
Inheritance graph
[legend]
Collaboration diagram for ACE_Local_Mutex:
Collaboration graph
[legend]

Public Member Functions

 ACE_Local_Mutex (const ACE_TCHAR *token_name=0, int ignore_deadlock=0, int debug=0)
 
 ~ACE_Local_Mutex (void)
 Destructor. More...
 
void dump (void) const
 Dump the state of the class. More...
 
virtual ACE_Token_Proxyclone (void) const
 Return deep copy. More...
 
- Public Member Functions inherited from ACE_Token_Proxy
 ACE_Token_Proxy (void)
 Construction. More...
 
virtual ~ACE_Token_Proxy (void)
 Destructor. More...
 
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. More...
 
virtual int tryacquire (void(*sleep_hook)(void *)=0)
 Calls renew on the token. More...
 
virtual int release (ACE_Synch_Options &options=ACE_Synch_Options::defaults)
 Calls release on the token. More...
 
virtual int remove (ACE_Synch_Options &options=ACE_Synch_Options::defaults)
 Calls remove on the token. More...
 
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_TCHARclient_id (void) const
 
virtual void client_id (const ACE_TCHAR *client_id)
 
virtual const ACE_TCHARname (void) const
 
virtual void sleep_hook (void)
 
virtual void token_acquired (ACE_TPQ_Entry *)
 
virtual const ACE_TCHARowner_id (void)
 The client id of the current token holder. More...
 
void dump (void) const
 Dump the state of the class. More...
 
virtual int type (void) const
 

Protected Member Functions

virtual ACE_Tokenscreate_token (const ACE_TCHAR *name)
 Return a new ACE_Local_Mutex. More...
 
- Protected Member Functions inherited from ACE_Token_Proxy
 ACE_Token_Proxy (const ACE_Token_Proxy &)
 Duplication. More...
 
int handle_options (ACE_Synch_Options &options, ACE_TOKEN_CONST::COND_VAR &cv)
 Handles cond_var waits. More...
 

Additional Inherited Members

- Protected Attributes inherited from ACE_Token_Proxy
int ignore_deadlock_
 If this is set, we ignore deadlock. More...
 
int debug_
 Print a bunch of debug messages. More...
 
ACE_Tokenstoken_
 
ACE_TSS_TPQ_Entry waiter_
 Waiter info used for asynchronous transactions. More...
 

Detailed Description

Class that acquires, renews, and releases a synchronization token local to the process.

This class is a more general-purpose synchronization mechanism than SunOS 5.x mutexes. For example, it implements "recursive mutex" 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 mutexes don't strictly enforce an acquisition order). Lastly, ACE_Local_Mutex performs deadlock detection on acquire calls. The interfaces for acquire, tryacquire, renew, release, etc. are defined in ACE_Token_Proxy. The semantics for ACE_Local_Mutex are that of a mutex.

Constructor & Destructor Documentation

ACE_Local_Mutex::ACE_Local_Mutex ( const ACE_TCHAR token_name = 0,
int  ignore_deadlock = 0,
int  debug = 0 
)
inline

Constructor.

Parameters
token_nameUniquely id's the token.
ignore_deadlockWill allow deadlock to occur (useful for testing).
debugPrints a bunch of messages.
ACE_Local_Mutex::~ACE_Local_Mutex ( void  )

Destructor.

Member Function Documentation

ACE_Token_Proxy * ACE_Local_Mutex::clone ( void  ) const
virtual

Return deep copy.

Implements ACE_Token_Proxy.

ACE_Tokens * ACE_Local_Mutex::create_token ( const ACE_TCHAR name)
protectedvirtual

Return a new ACE_Local_Mutex.

Implements ACE_Token_Proxy.

void ACE_Local_Mutex::dump ( void  ) const

Dump the state of the class.


The documentation for this class was generated from the following files: