diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-07-27 10:20:25 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-07-27 10:20:25 +0000 |
commit | b0eaac93d465dfab2784072a786b49653adc6aa5 (patch) | |
tree | bca6d1345896fc594f47eb4f00aa9cc3c808bd0e /ACE/ace/Thread_Mutex.inl | |
parent | 86cb0fa34681c88434629f5c93aca6b43cb2deb2 (diff) | |
download | ATCD-b0eaac93d465dfab2784072a786b49653adc6aa5.tar.gz |
ChangeLogTag: Thu Jul 27 10:14:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/ace/Thread_Mutex.inl')
-rw-r--r-- | ACE/ace/Thread_Mutex.inl | 79 |
1 files changed, 2 insertions, 77 deletions
diff --git a/ACE/ace/Thread_Mutex.inl b/ACE/ace/Thread_Mutex.inl index 7658522b38f..146521722dd 100644 --- a/ACE/ace/Thread_Mutex.inl +++ b/ACE/ace/Thread_Mutex.inl @@ -86,87 +86,12 @@ ACE_Thread_Mutex::remove (void) { // ACE_TRACE ("ACE_Thread_Mutex::remove"); int result = 0; - if (this->removed_ == 0) + if (this->removed_ == false) { - this->removed_ = 1; + this->removed_ = true; result = ACE_OS::thread_mutex_destroy (&this->lock_); } return result; } -#if defined (ACE_USES_OBSOLETE_GUARD_CLASSES) -ACE_INLINE int -ACE_Thread_Mutex_Guard::locked (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex_Guard::locked"); - return this->owner_ != -1; -} - -// Explicitly acquire the lock. - -ACE_INLINE int -ACE_Thread_Mutex_Guard::acquire (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex_Guard::acquire"); - return this->owner_ = this->lock_.acquire (); -} - -// Conditionally acquire the lock (i.e., won't block). - -ACE_INLINE int -ACE_Thread_Mutex_Guard::tryacquire (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex_Guard::tryacquire"); - return this->owner_ = this->lock_.tryacquire (); -} - -// Implicitly and automatically acquire the lock. - -ACE_INLINE -ACE_Thread_Mutex_Guard::ACE_Thread_Mutex_Guard (ACE_Thread_Mutex &m, - int block) - : lock_ (m) -{ -// ACE_TRACE ("ACE_Thread_Mutex_Guard::ACE_Thread_Mutex_Guard"); - if (block) - this->acquire (); - else - this->tryacquire (); -} - -// Explicitly release the lock. - -ACE_INLINE int -ACE_Thread_Mutex_Guard::release (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex_Guard::release"); - if (this->owner_ != -1) - { - this->owner_ = -1; - return this->lock_.release (); - } - else - return 0; -} - -// Implicitly release the lock. - -ACE_INLINE -ACE_Thread_Mutex_Guard::~ACE_Thread_Mutex_Guard (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex_Guard::~ACE_Thread_Mutex_Guard"); - this->release (); -} - -// Explicitly release the lock. - -ACE_INLINE int -ACE_Thread_Mutex_Guard::remove (void) -{ -// ACE_TRACE ("ACE_Thread_Mutex_Guard::remove"); - this->owner_ = -1; - return this->release (); -} -#endif /* ACE_USES_OBSOLETE_GUARD_CLASSES */ - ACE_END_VERSIONED_NAMESPACE_DECL |