ACE_Lock Class ReferenceThis is the abstract base class that contains the uniform locking API that is supported by all the ACE synchronization mechanisms. More...
Inheritance diagram for ACE_Lock:
![]()
Detailed DescriptionThis is the abstract base class that contains the uniform locking API that is supported by all the ACE synchronization mechanisms.This class is typically used in conjunction with the ACE_Lock_Adapter in order to provide a polymorphic interface to the ACE synchronization mechanisms (e.g., ACE_Mutex, ACE_Semaphore, ACE_RW_Mutex, etc). Note that the reason that all of ACE doesn't use polymorphic locks is that (1) they add ~20% extra overhead for virtual function calls and (2) objects with virtual functions can't be placed into shared memory. Constructor & Destructor Documentation
CE needs a default ctor here.
Noop virtual destructor.
Member Function Documentation
Explicitly destroy the lock. Note that only one thread should call this method since it doesn't protect against race conditions. Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
Block the thread until the lock is acquired. Returns -1 on failure. Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
Conditionally acquire the lock (i.e., won't block). Returns -1 on failure. If we "failed" because someone else already had the lock, Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
Release the lock. Returns -1 on failure.
Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
Block until the thread acquires a read lock. If the locking mechanism doesn't support read locks then this just calls <acquire>. Returns -1 on failure. Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
Block until the thread acquires a write lock. If the locking mechanism doesn't support read locks then this just calls <acquire>. Returns -1 on failure. Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
Conditionally acquire a read lock. If the locking mechanism doesn't support read locks then this just calls <acquire>. Returns -1 on failure. If we "failed" because someone else already had the lock, Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
Conditionally acquire a write lock. If the locking mechanism doesn't support read locks then this just calls <acquire>. Returns -1 on failure. If we "failed" because someone else already had the lock, Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
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. Implemented in ACE_Adaptive_Lock, ACE_Lock_Adapter< ACE_LOCKING_MECHANISM >, ACE_Reverse_Lock< ACE_LOCKING_MECHANISM >, ACE_Lock_Adapter< ACE_SELECT_REACTOR_TOKEN >, and ACE_Lock_Adapter< ACE_Select_Reactor_Token >.
The documentation for this class was generated from the following files: Generated on Mon Sep 15 07:15:25 2008 for ACE by ![]() |