NAME
ACE_Local_Mutex -
Class that acquires, renews, and releases a synchronization
token local to the process.
SYNOPSIS
#include <ace/Local_Tokens>
class ACE_Local_Mutex : public ACE_Token_Proxy
{
public:
ACE_Local_Mutex (
const char *token_name = 0,
int ignore_deadlock = 0,
int debug = 0
);
void dump (void) const;
virtual ACE_Token_Proxy *clone (void) const;
protected:
virtual ACE_Tokens *create_token (const char *name);
};
DESCRIPTION
This file contains definitions for the following classes:
public:
7. ACE_Token_Proxy
8. ACE_Null_Token : public ACE_Token_Proxy
9. ACE_Local_Mutex : public ACE_Token_Proxy
*. ACE_Local_RLock : public ACE_Local_Mutex
&. ACE_Local_WLock : public ACE_Local_Mutex
private:
1. ACE_TOKEN_CONST
3. ACE_TPQ_Entry
b. ACE_TSS_TPQ_Entry
c. ACE_TPQ_Iterator
4. ACE_Token_Proxy_Queue
5. ACE_Tokens
6. ACE_Mutex_Token : public ACE_Tokens
12. ACE_RW_Token : public ACE_Tokens
a. ACE_Token_Name
PUBLIC MEMBERS
ACE_Local_Mutex (
const char *token_name = 0,
int ignore_deadlock = 0,
int debug = 0
);
token_name
uniquely id's the token.
ignore_deadlock
will allow deadlock to occur (useful for
testing). debug
prints a bunch of messages.
void dump (void) const;
Dump the state of the class.
virtual ACE_Token_Proxy *clone (void) const;
PROTECTED MEMBERS
virtual ACE_Tokens *create_token (const char *name);
Return a new ACE_Local_Mutex.
AUTHOR
Karl-Heinz Dorn (kdorn@erlh.siemens.de)
Douglas C. Schmidt (schmidt@cs.wustl.edu)
Tim Harrison (harrison@cs.wustl.edu)
DESCRIPTION
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.
Synchronization operations.
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.
LIBRARY
ace