ACE_Guard< ACE_LOCK > Class Template ReferenceThis data structure is meant to be used within a method or function... It performs automatic aquisition and release of a parameterized synchronization object <ACE_LOCK>. More...
Inheritance diagram for ACE_Guard< ACE_LOCK >:
![]()
Collaboration diagram for ACE_Guard< ACE_LOCK >:
![]()
Detailed Descriptiontemplate<class ACE_LOCK>
This data structure is meant to be used within a method or function... It performs automatic aquisition and release of a parameterized synchronization object <ACE_LOCK>.
|
ACE_INLINE ACE_Guard< ACE_LOCK >::ACE_Guard | ( | ACE_LOCK & | l, | |
bool | block | |||
) | [inline] |
Implicitly and automatically acquire (or try to acquire) the lock. If block is non-0 then <acquire> the <ACE_LOCK>, else <tryacquire> it.
ACE_INLINE ACE_Guard< ACE_LOCK >::ACE_Guard | ( | ACE_LOCK & | l, | |
bool | block, | |||
int | become_owner | |||
) | [inline] |
Initialise 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.
Implicitly release the lock.
Helper, meant for subclass only.
ACE_Guard< ACE_LOCK >::ACE_Guard | ( | const ACE_Guard< ACE_LOCK > & | ) | [private] |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_Guard< ACE_LOCK >::acquire | ( | void | ) | [inline] |
Explicitly acquire the lock.
Reimplemented in ACE_Write_Guard< ACE_LOCK >, and ACE_Read_Guard< ACE_LOCK >.
ACE_INLINE int ACE_Guard< ACE_LOCK >::tryacquire | ( | void | ) | [inline] |
Conditionally acquire the lock (i.e., won't block).
Reimplemented in ACE_Write_Guard< ACE_LOCK >, and ACE_Read_Guard< ACE_LOCK >.
ACE_INLINE int ACE_Guard< ACE_LOCK >::release | ( | void | ) | [inline] |
Explicitly release the lock, but only if it is held!
ACE_INLINE void ACE_Guard< ACE_LOCK >::disown | ( | void | ) | [inline] |
Relinquish ownership of the lock so that it is not released implicitly in the destructor.
ACE_INLINE int ACE_Guard< ACE_LOCK >::locked | ( | void | ) | const [inline] |
1 if locked, 0 if couldn't acquire the lock (errno will contain the reason for this).
ACE_INLINE int ACE_Guard< ACE_LOCK >::remove | ( | void | ) | [inline] |
Explicitly remove the lock.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL void ACE_Guard< ACE_LOCK >::dump | ( | void | ) | const [inline] |
Dump the state of an object.
Reimplemented in ACE_Write_Guard< ACE_LOCK >, and ACE_Read_Guard< ACE_LOCK >.
void ACE_Guard< ACE_LOCK >::operator= | ( | const ACE_Guard< ACE_LOCK > & | ) | [private] |
Pointer to the ACE_LOCK we're guarding.
Keeps track of whether we acquired the lock or failed.