summaryrefslogtreecommitdiff
path: root/ace/Synch.i
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1999-01-05 07:00:52 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1999-01-05 07:00:52 +0000
commit8fb663fe0e39f66db28dfab24e1bff515c7734a5 (patch)
tree7ac2b580156255f4a4def09a54487ad8eb13ba88 /ace/Synch.i
parent22d87fda71d79af02ca40832b3536e45e1ed2e45 (diff)
downloadATCD-8fb663fe0e39f66db28dfab24e1bff515c7734a5.tar.gz
.
Diffstat (limited to 'ace/Synch.i')
-rw-r--r--ace/Synch.i33
1 files changed, 23 insertions, 10 deletions
diff --git a/ace/Synch.i b/ace/Synch.i
index 82af0f2ab94..2502190d2ac 100644
--- a/ace/Synch.i
+++ b/ace/Synch.i
@@ -60,7 +60,14 @@ ACE_File_Lock::remove (void)
{
// ACE_TRACE ("ACE_File_Lock::remove");
- return ACE_OS::flock_destroy (&this->lock_);
+ int result = 0;
+
+ if (this->removed_ == 0)
+ {
+ this->removed_ = 1;
+ result = ACE_OS::flock_destroy (&this->lock_);
+ }
+ return result;
}
ACE_INLINE ACE_HANDLE
@@ -248,18 +255,24 @@ ACE_Mutex::remove (void)
{
// ACE_TRACE ("ACE_Mutex::remove");
#if defined (CHORUS)
- int result = -1;
+ int result = 0;
// Are we the owner?
if (this->process_lock_ && this->lockname_)
{
- // Only destroy the lock if we're the ones who initialized it.
- result = ACE_OS::mutex_destroy (this->process_lock_);
- ACE_OS::munmap (this->process_lock_,
- sizeof (ACE_mutex_t));
- ACE_OS::shm_unlink (this->lockname_);
- ACE_OS::free (ACE_static_cast (void *,
- ACE_const_cast (LPTSTR,
- this->lockname_)));
+ if (this->removed_ == 0)
+ {
+ this->removed_ = 1;
+
+ // Only destroy the lock if we're the ones who initialized
+ // it.
+ result = ACE_OS::mutex_destroy (this->process_lock_);
+ ACE_OS::munmap (this->process_lock_,
+ sizeof (ACE_mutex_t));
+ ACE_OS::shm_unlink (this->lockname_);
+ ACE_OS::free (ACE_static_cast (void *,
+ ACE_const_cast (LPTSTR,
+ this->lockname_)));
+ }
}
else if (this->process_lock_)
{