#include <Synch.h>
Inheritance diagram for ACE_Lock
Public Methods | |
ACE_Lock (void) | |
CE needs a default ctor here. | |
virtual | ~ACE_Lock (void) |
Noop virtual destructor. | |
virtual int | remove (void) = 0 |
virtual int | acquire (void) = 0 |
Block the thread until the lock is acquired. Returns -1 on failure. | |
virtual int | tryacquire (void) = 0 |
virtual int | release (void) = 0 |
Release the lock. Returns -1 on failure. | |
virtual int | acquire_read (void) = 0 |
virtual int | acquire_write (void) = 0 |
virtual int | tryacquire_read (void) = 0 |
virtual int | tryacquire_write (void) = 0 |
virtual int | tryacquire_write_upgrade (void) = 0 |
This class is typically used in conjunction with the in order to provide a polymorphic interface to the ACE synchronization mechanisms (e.g., , , , 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.
|
CE needs a default ctor here.
|
|
Noop virtual destructor.
|
|
Block the thread until the lock is acquired. Returns -1 on failure.
Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
Block until the thread acquires a read lock. If the locking mechanism doesn't support read locks then this just calls . Returns -1 on failure. Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
Block until the thread acquires a write lock. If the locking mechanism doesn't support read locks then this just calls . Returns -1 on failure. Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
Release the lock. Returns -1 on failure.
Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
Explicitly destroy the lock. Note that only one thread should call this method since it doesn't protect against race conditions. Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
Conditionally acquire the lock (i.e., won't block). Returns -1 on failure. If we "failed" because someone else already had the lock, <errno> is set to <EBUSY>. Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
Conditionally acquire a read lock. If the locking mechanism doesn't support read locks then this just calls . Returns -1 on failure. If we "failed" because someone else already had the lock, <errno> is set to <EBUSY>. Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
Conditionally acquire a write lock. If the locking mechanism doesn't support read locks then this just calls . Returns -1 on failure. If we "failed" because someone else already had the lock, <errno> is set to <EBUSY>. Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |
|
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 . Returns 0 on success, -1 on failure. Reimplemented in ACE_Adaptive_Lock, ACE_Lock_Adapter, and ACE_Reverse_Lock. |