Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

# ACE_Local_WLock Class Reference

Class that acquires, renews, and releases a writer lock that is local to the process. More...

`#include <Local_Tokens.h>`

Inheritance diagram for ACE_Local_WLock:

[legend]
Collaboration diagram for ACE_Local_WLock:

[legend]
List of all members.

## Public Member Functions
| ACE_Local_WLock (const ACE_TCHAR *token_name=0, int ignore_deadlock=0, int debug=0)
| ~ACE_Local_WLock (void)
| Destructor.
void | dump (void) const
| Dump the state of the class.
virtual int | type (void) const
| Returns ACE_RW_Token::WLOCK.
virtual ACE_Token_Proxy * | clone (void) const
| Return deep copy.
## Protected Member Functions
ACE_Tokens * | create_token (const ACE_TCHAR *name)
| Return a new ACE_Local_Mutex.

## Detailed Description

Class that acquires, renews, and releases a writer lock that is local to the process.

This class implements the writer interface to canonical readers/writer locks. Multiple readers can hold the lock simultaneously when no writers have the lock. Alternatively, when a writer holds the lock, no other participants (readers or writers) may hold the lock. This class is a more general-purpose synchronization mechanism than SunOS 5.x WLock. For example, it implements "recursive WLock" 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 WLocks don't strictly enforce an acquisition order). The interfaces for acquire, tryacquire, renew, release, etc. are defined in ACE_Token_Proxy. The semantics for ACE_Local_WLock are that of a readers/writers lock. Acquire for this class implies a writer acquisition. That is, only one client may hold the lock for writing.

## Constructor & Destructor Documentation

ACE_Local_WLock::ACE_Local_WLock | ( | const ACE_TCHAR * | token_name = `0`,
|  | int | ignore_deadlock = `0`,
|  | int | debug = `0`
| ) |

  | Constructor. Parameters:
  | token_name | Uniquely id's the token.
  | ignore_deadlock | Will allow deadlock to occur (useful for testing).
  | debug | Prints a bunch of messages.

ACE_Local_WLock::~ACE_Local_WLock | ( | void |  | ) |

| Destructor.

## Member Function Documentation

ACE_Token_Proxy * ACE_Local_WLock::clone | ( | void |  | ) | const`[virtual]`

| Return deep copy. Implements ACE_Token_Proxy.

ACE_Tokens * ACE_Local_WLock::create_token | ( | const ACE_TCHAR * | name | ) | `[protected, virtual]`

| Return a new ACE_Local_Mutex. Implements ACE_Token_Proxy.

void ACE_Local_WLock::dump | ( | void |  | ) | const

| Dump the state of the class. Reimplemented from ACE_Token_Proxy.

int ACE_Local_WLock::type | ( | void |  | ) | const`[virtual]`

| Returns ACE_RW_Token::WLOCK. Reimplemented from ACE_Token_Proxy.

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

- Local_Tokens.h
- Local_Tokens.cpp