ACE_Lock_Adapter< ACE_LOCKING_MECHANISM > Class Template ReferenceThis is an adapter that allows applications to transparently combine the <ACE_Lock> abstract base class (which contains pure virtual methods) with any of the other concrete ACE synchronization classes (e.g., ACE_Mutex, ACE_Semaphore, ACE_RW_Mutex, etc.). More...
Inheritance diagram for ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >:
![]()
Collaboration diagram for ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >:
![]()
Detailed Descriptiontemplate<class ACE_LOCKING_MECHANISM>
This is an adapter that allows applications to transparently combine the <ACE_Lock> abstract base class (which contains pure virtual methods) with any of the other concrete ACE synchronization classes (e.g., ACE_Mutex, ACE_Semaphore, ACE_RW_Mutex, etc.).
|
typedef ACE_LOCKING_MECHANISM ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::ACE_LOCK |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::ACE_Lock_Adapter | ( | ACE_LOCKING_MECHANISM & | lock | ) | [inline] |
Constructor. All locking requests will be forwarded to <lock>.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::ACE_Lock_Adapter | ( | void | ) | [inline] |
Constructor. Since no lock is provided by the user, one will be created internally.
ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::~ACE_Lock_Adapter | ( | void | ) | [inline, virtual] |
Destructor. If <lock_> was not passed in by the user, it will be deleted.
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::acquire | ( | void | ) | [inline, virtual] |
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire | ( | void | ) | [inline, virtual] |
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::release | ( | void | ) | [inline, virtual] |
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::acquire_read | ( | void | ) | [inline, virtual] |
Block until the thread acquires a read lock. If the locking mechanism doesn't support read locks then this just calls <acquire>.
Implements ACE_Lock.
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::acquire_write | ( | void | ) | [inline, virtual] |
Block until the thread acquires a write lock. If the locking mechanism doesn't support read locks then this just calls <acquire>.
Implements ACE_Lock.
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire_read | ( | void | ) | [inline, virtual] |
Conditionally acquire a read lock. If the locking mechanism doesn't support read locks then this just calls <acquire>.
Implements ACE_Lock.
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire_write | ( | void | ) | [inline, virtual] |
Conditionally acquire a write lock. If the locking mechanism doesn't support read locks then this just calls <acquire>.
Implements ACE_Lock.
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::tryacquire_write_upgrade | ( | void | ) | [inline, virtual] |
Conditionally try to upgrade a lock held for read to a write lock. If the locking mechanism doesn't support read locks then this just calls <acquire>. Returns 0 on success, -1 on failure.
Implements ACE_Lock.
int ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::remove | ( | void | ) | [inline, virtual] |
ACE_LOCKING_MECHANISM* ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::lock_ [private] |
The concrete locking mechanism that all the methods delegate to.
bool ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >::delete_lock_ [private] |
This flag keep track of whether we are responsible for deleting the lock