ACE 7.0.9
|
This data structure is meant to be used within a method or function... It performs automatic acquisition and release of a parameterized synchronization object ACE_LOCK. More...
#include <Guard_T.h>
Public Member Functions | |
ACE_Guard (ACE_LOCK &l) | |
ACE_Guard (ACE_LOCK &l, bool block) | |
ACE_Guard (ACE_LOCK &l, bool block, int become_owner) | |
~ACE_Guard () | |
Implicitly release the lock. More... | |
int | acquire () |
Explicitly acquire the lock. More... | |
int | tryacquire () |
Conditionally acquire the lock (i.e., won't block). More... | |
int | release () |
Explicitly release the lock, but only if it is held! More... | |
void | disown () |
bool | locked () const |
int | remove () |
Explicitly remove the lock. More... | |
void | dump () const |
Dump the state of an object. More... | |
Protected Member Functions | |
ACE_Guard (ACE_LOCK *lock) | |
Helper, meant for subclass only. More... | |
Protected Attributes | |
ACE_LOCK * | lock_ |
Pointer to the ACE_LOCK we're guarding. More... | |
int | owner_ |
Keeps track of whether we acquired the lock or failed. More... | |
Private Member Functions | |
void | operator= (const ACE_Guard< ACE_LOCK > &)=delete |
ACE_Guard (const ACE_Guard< ACE_LOCK > &)=delete | |
This data structure is meant to be used within a method or function... It performs automatic acquisition and release of a parameterized synchronization object ACE_LOCK.
The ACE_LOCK class given as an actual parameter must provide, at the very least the acquire(), tryacquire(), release(), and remove() methods.
|
inline |
|
inline |
Implicitly and automatically acquire (or try to acquire) the lock. If block is non-0 then acquire() the ACE_LOCK, else tryacquire() it.
|
inline |
Initialize the guard without implicitly acquiring the lock. The become_owner parameter indicates whether the guard should release the lock implicitly on destruction. The block parameter is ignored and is used here to disambiguate with the preceding constructor.
|
inlineprotected |
Helper, meant for subclass only.
|
privatedelete |
|
inline |
Explicitly acquire the lock.
|
inline |
Relinquish ownership of the lock so that it is not released implicitly in the destructor.
void ACE_Guard< ACE_LOCK >::dump |
Dump the state of an object.
|
inline |
true if locked, false if couldn't acquire the lock (errno will contain the reason for this).
|
privatedelete |
|
inline |
Explicitly release the lock, but only if it is held!
|
inline |
Explicitly remove the lock.
|
inline |
Conditionally acquire the lock (i.e., won't block).
|
protected |
Pointer to the ACE_LOCK we're guarding.
|
protected |
Keeps track of whether we acquired the lock or failed.