summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/Cond.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceUtil/Cond.cpp')
-rw-r--r--cpp/src/IceUtil/Cond.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp
index 24ab3bd414d..29b76783186 100644
--- a/cpp/src/IceUtil/Cond.cpp
+++ b/cpp/src/IceUtil/Cond.cpp
@@ -200,7 +200,23 @@ IceUtil::Cond::timedDowait(const Time& timeout) const
IceUtil::Cond::Cond()
{
- int rc = pthread_cond_init(&_cond, 0);
+ int rc;
+
+ pthread_condattr_t attr;
+
+ rc = pthread_condattr_init(&attr);
+ if(rc != 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__);
+ }
+
+ rc = pthread_cond_init(&_cond, &attr);
+ if(rc != 0)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__);
+ }
+
+ rc = pthread_condattr_destroy(&attr);
if(rc != 0)
{
throw ThreadSyscallException(__FILE__, __LINE__);