diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-28 07:14:18 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-28 07:14:18 +0000 |
commit | cdeedf87b106854013dd8b2aefaaacd83a37c2b1 (patch) | |
tree | b679cecc050588c642722e7dffd780ed81a442eb /ace/Synch_T.h | |
parent | 202b4d050bf2a57c3bf6473a8c5cf8afd65ed5f7 (diff) | |
download | ATCD-cdeedf87b106854013dd8b2aefaaacd83a37c2b1.tar.gz |
yow
Diffstat (limited to 'ace/Synch_T.h')
-rw-r--r-- | ace/Synch_T.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ace/Synch_T.h b/ace/Synch_T.h index 0f559bd2271..1353bcf7b88 100644 --- a/ace/Synch_T.h +++ b/ace/Synch_T.h @@ -259,8 +259,17 @@ public: int tryacquire (void) { return this->owner_ = this->lock_->tryacquire (); } // Conditionally acquire the lock (i.e., won't block). - int release (void) { this->owner_ = -1; return this->lock_->release (); } - // Explicitly release the lock. + int release (void) + { + if (this->owner_ != -1) + { + this->owner_ = -1; + return this->lock_->release (); + } + else + return 0; + } + // Explicitly release the lock, but only if it is held! void dump (void) const; // Dump the state of an object. |