diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-11-07 18:14:35 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-11-07 18:14:35 +0000 |
commit | 4d98fa10a9ede4d5c8b2de3813b0b4eb54841c29 (patch) | |
tree | d2fda833b09989ef93d222aa40712d3df331a988 /cpp/src/IceUtil/CountDownLatch.cpp | |
parent | Modified print statements to not overlap (diff) | |
download | ice-4d98fa10a9ede4d5c8b2de3813b0b4eb54841c29.tar.bz2 ice-4d98fa10a9ede4d5c8b2de3813b0b4eb54841c29.tar.xz ice-4d98fa10a9ede4d5c8b2de3813b0b4eb54841c29.zip |
Added destructor to IceUtil::CountDownLatch
Diffstat (limited to 'cpp/src/IceUtil/CountDownLatch.cpp')
-rw-r--r-- | cpp/src/IceUtil/CountDownLatch.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/IceUtil/CountDownLatch.cpp b/cpp/src/IceUtil/CountDownLatch.cpp index 8987e3c0bdb..81910f41cf9 100644 --- a/cpp/src/IceUtil/CountDownLatch.cpp +++ b/cpp/src/IceUtil/CountDownLatch.cpp @@ -19,8 +19,8 @@ IceUtil::CountDownLatch::CountDownLatch(int count) : } #ifdef _WIN32 - _event = CreateEvent(NULL, TRUE, FALSE, NULL); - if(_event == NULL) + _event = CreateEvent(0, TRUE, FALSE, 0); + if(_event == 0) { throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } @@ -39,6 +39,18 @@ IceUtil::CountDownLatch::CountDownLatch(int count) : #endif } +IceUtil::CountDownLatch::~CountDownLatch() +{ +#ifdef _WIN32 + CloseHandle(_event); +#else + int rc = 0; + rc = pthread_mutex_destroy(&_mutex); + assert(rc == 0); + rc = pthread_cond_destroy(&_cond); + assert(rc == 0); +#endif +} void IceUtil::CountDownLatch::await() const |