diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-02-27 19:39:46 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-02-27 19:39:46 +0000 |
commit | 309225c29083765eed35e47bbc5ae7c16939e9b1 (patch) | |
tree | 79c5c4828b13e2442373c8449c1fde98e17d34f5 /ace/Synch_T.i | |
parent | cf4fdf6265b9ba2b25bd1f90f2c6be1c84a246c5 (diff) | |
download | ATCD-309225c29083765eed35e47bbc5ae7c16939e9b1.tar.gz |
.
Diffstat (limited to 'ace/Synch_T.i')
-rw-r--r-- | ace/Synch_T.i | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ace/Synch_T.i b/ace/Synch_T.i index f6cd64770ca..aad930f487f 100644 --- a/ace/Synch_T.i +++ b/ace/Synch_T.i @@ -23,6 +23,7 @@ ACE_Guard<ACE_LOCK>::ACE_Guard (ACE_LOCK &l, int block) else this->tryacquire (); } + // Implicitly and automatically acquire (or try to acquire) the // lock. @@ -31,6 +32,7 @@ ACE_Guard<ACE_LOCK>::~ACE_Guard (void) { this->release (); } + // Implicitly release the lock. template <class ACE_LOCK> ACE_INLINE int @@ -38,6 +40,7 @@ ACE_Guard<ACE_LOCK>::acquire (void) { return this->owner_ = this->lock_->acquire (); } + // Explicitly acquire the lock. template <class ACE_LOCK> ACE_INLINE int @@ -45,19 +48,21 @@ ACE_Guard<ACE_LOCK>::tryacquire (void) { return this->owner_ = this->lock_->tryacquire (); } + // Conditionally acquire the lock (i.e., won't block). template <class ACE_LOCK> ACE_INLINE int ACE_Guard<ACE_LOCK>::release (void) { if (this->owner_ != -1) - { - this->owner_ = -1; - return this->lock_->release (); - } + { + this->owner_ = -1; + return this->lock_->release (); + } else return 0; } + // Explicitly release the lock, but only if it is held! template <class ACE_LOCK> ACE_INLINE int @@ -65,6 +70,7 @@ ACE_Guard<ACE_LOCK>::locked (void) { return this->owner_ != -1; } + // 1 if locked, 0 if couldn't acquire the lock // (errno will contain the reason for this). |