summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/CountDownLatch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/CountDownLatch.cpp')
-rw-r--r--cpp/src/Ice/CountDownLatch.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/cpp/src/Ice/CountDownLatch.cpp b/cpp/src/Ice/CountDownLatch.cpp
index cbdd4d5bcf2..eb0422ba7e9 100644
--- a/cpp/src/Ice/CountDownLatch.cpp
+++ b/cpp/src/Ice/CountDownLatch.cpp
@@ -15,7 +15,7 @@ IceUtilInternal::CountDownLatch::CountDownLatch(int count) :
{
if(count < 0)
{
- throw IceUtil::Exception(__FILE__, __LINE__);
+ throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "count must be greather than 0");
}
#ifdef _WIN32
@@ -34,12 +34,12 @@ IceUtilInternal::CountDownLatch::CountDownLatch(int count) :
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rc);
}
-
+
rc = pthread_cond_init(&_cond, 0);
if(rc != 0)
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ }
#endif
}
@@ -60,7 +60,7 @@ IceUtilInternal::CountDownLatch::~CountDownLatch()
#endif
}
-void
+void
IceUtilInternal::CountDownLatch::await() const
{
#ifdef _WIN32
@@ -72,7 +72,7 @@ IceUtilInternal::CountDownLatch::await() const
DWORD rc = WaitForSingleObjectEx(_event, INFINITE, false);
# endif
assert(rc == WAIT_OBJECT_0 || rc == WAIT_FAILED);
-
+
if(rc == WAIT_FAILED)
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError());
@@ -90,11 +90,11 @@ IceUtilInternal::CountDownLatch::await() const
}
}
unlock();
-
+
#endif
}
-void
+void
IceUtilInternal::CountDownLatch::countDown()
{
#ifdef _WIN32
@@ -129,10 +129,10 @@ IceUtilInternal::CountDownLatch::countDown()
}
}
unlock();
-
+
#else
unlock();
-
+
if(broadcast)
{
int rc = pthread_cond_broadcast(&_cond);
@@ -146,7 +146,7 @@ IceUtilInternal::CountDownLatch::countDown()
#endif
}
-int
+int
IceUtilInternal::CountDownLatch::getCount() const
{
#ifdef _WIN32