ACE
6.3.3
|
An adaptive general locking class that defers the decision of lock type to run time. More...
#include <Lock.h>
Public Member Functions | |
virtual | ~ACE_Adaptive_Lock (void) |
virtual int | remove (void) |
virtual int | acquire (void) |
virtual int | tryacquire (void) |
virtual int | release (void) |
Release the lock. Returns -1 on failure. More... | |
virtual int | acquire_read (void) |
virtual int | acquire_write (void) |
virtual int | tryacquire_read (void) |
virtual int | tryacquire_write (void) |
virtual int | tryacquire_write_upgrade (void) |
void | dump (void) const |
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... | |
Protected Member Functions | |
ACE_Adaptive_Lock (void) | |
Protected Attributes | |
ACE_Lock * | lock_ |
An adaptive general locking class that defers the decision of lock type to run time.
This class, as ACE_Lock, provide a set of general locking APIs. However, it defers our decision of what kind of lock to use to the run time and delegates all locking operations to the actual lock. Users must define a constructor in their subclass to initialize lock_
.
|
virtual |
You must also override the destructor function to match with how you construct the underneath lock_
.
|
protected |
Create and initialize create the actual lock used in the class. The default constructor simply set the lock_
to 0 (null). You must overwrite this method for this class to work.
|
virtual |
Block the thread until the lock is acquired. Returns -1 on failure.
Implements ACE_Lock.
|
virtual |
|
virtual |
void ACE_Adaptive_Lock::dump | ( | void | ) | const |
|
virtual |
Release the lock. Returns -1 on failure.
Implements ACE_Lock.
|
virtual |
Explicitly destroy the lock. Note that only one thread should call this method since it doesn't protect against race conditions.
Implements ACE_Lock.
|
virtual |
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
.
Implements ACE_Lock.
|
virtual |
|
virtual |
|
virtual |
|
protected |