summaryrefslogtreecommitdiff
path: root/ace/SV_Semaphore_Complex.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-12-02 02:31:08 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-12-02 02:31:08 +0000
commit557dbbc2d3c4e6cc828b0902d116224a29094e0a (patch)
treed3c213e139b90e270be9a81875818cfa5a701ed4 /ace/SV_Semaphore_Complex.cpp
parentfb04ad9a58a77ead45653c1a24669e924b980ce0 (diff)
downloadATCD-557dbbc2d3c4e6cc828b0902d116224a29094e0a.tar.gz
hello
Diffstat (limited to 'ace/SV_Semaphore_Complex.cpp')
-rw-r--r--ace/SV_Semaphore_Complex.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/ace/SV_Semaphore_Complex.cpp b/ace/SV_Semaphore_Complex.cpp
index 776907705f3..836a0cbabf2 100644
--- a/ace/SV_Semaphore_Complex.cpp
+++ b/ace/SV_Semaphore_Complex.cpp
@@ -138,7 +138,7 @@ ACE_SV_Semaphore_Complex::open (key_t k,
// Decrement the process counter. We don't need a lock to do this.
if (ACE_OS::semop (this->internal_id_,
- &ACE_SV_Semaphore_Complex::op_open_[0], 1) < 0)
+ &ACE_SV_Semaphore_Complex::op_open_[0], 1) < 0)
return this->init ();
return 0;
}
@@ -219,8 +219,15 @@ ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (const char *name,
int perms)
{
ACE_TRACE ("ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex");
- if (this->open (ACE_SV_Semaphore_Simple::name_2_key (name),
- flags, initial_value, nsems, perms) == -1)
+
+ key_t key;
+
+ if (name == 0)
+ key = ACE_DEFAULT_SEM_KEY;
+ else
+ key = this->name_2_key (name);
+
+ if (this->open (key, flags, initial_value, nsems, perms) == -1)
ACE_ERROR ((LM_ERROR, "%p\n", "ACE_SV_Semaphore_Complex"));
}
@@ -236,4 +243,3 @@ ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (void)
ACE_TRACE ("ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex");
this->init ();
}
-