ACE
6.3.3
|
A reverse (or anti) lock. More...
#include <Reverse_Lock_T.h>
Public Types | |
typedef ACE_LOCKING_MECHANISM | ACE_LOCK |
Public Member Functions | |
ACE_Reverse_Lock (ACE_LOCKING_MECHANISM &lock, ACE_Acquire_Method::METHOD_TYPE acquire_method=ACE_Acquire_Method::ACE_REGULAR) | |
Constructor. All locking requests will be forwarded to lock. More... | |
virtual | ~ACE_Reverse_Lock (void) |
virtual int | acquire (void) |
Release the lock. More... | |
virtual int | tryacquire (void) |
Release the lock. More... | |
virtual int | release (void) |
Acquire the lock. More... | |
virtual int | acquire_read (void) |
Release the lock. More... | |
virtual int | acquire_write (void) |
Release the lock. More... | |
virtual int | tryacquire_read (void) |
Release the lock. More... | |
virtual int | tryacquire_write (void) |
Release the lock. More... | |
virtual int | tryacquire_write_upgrade (void) |
Release the lock. More... | |
virtual int | remove (void) |
Explicitly destroy the lock. More... | |
Public Member Functions inherited from ACE_Lock | |
ACE_Lock (void) | |
CE needs a default constructor here. More... | |
virtual | ~ACE_Lock (void) |
Noop virtual destructor. More... | |
Private Attributes | |
ACE_LOCKING_MECHANISM & | lock_ |
The concrete locking mechanism that all the methods delegate to. More... | |
ACE_Acquire_Method::METHOD_TYPE | acquire_method_ |
This indicates what kind of acquire method will be called. More... | |
A reverse (or anti) lock.
This is an interesting adapter class that changes a lock into a reverse lock, i.e., <acquire> on this class calls <release> on the lock, and <release> on this class calls <acquire> on the lock. One motivation for this class is when we temporarily want to release a lock (which we have already acquired) but then reacquire it soon after. An alternative design would be to add a Anti_Guard or Reverse_Guard class which would <release> on construction and <acquire> destruction. However, there are many varieties of the Guard class and this design choice would lead to at least 6 new classes. One new ACE_Reverse_Lock class seemed more reasonable.
typedef ACE_LOCKING_MECHANISM ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >::ACE_LOCK |
|
inline |
Constructor. All locking requests will be forwarded to lock.
|
virtual |
Destructor. If <lock_> was not passed in by the user, it will be deleted.
|
virtual |
Release the lock.
Implements ACE_Lock.
|
virtual |
Release the lock.
Implements ACE_Lock.
|
virtual |
Release the lock.
Implements ACE_Lock.
|
virtual |
Acquire the lock.
Implements ACE_Lock.
|
virtual |
Explicitly destroy the lock.
Implements ACE_Lock.
|
virtual |
Release the lock.
Implements ACE_Lock.
|
virtual |
Release the lock.
Implements ACE_Lock.
|
virtual |
Release the lock.
Implements ACE_Lock.
|
virtual |
Release the lock.
Implements ACE_Lock.
|
private |
This indicates what kind of acquire method will be called.
|
private |
The concrete locking mechanism that all the methods delegate to.