summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2004-04-19 21:44:50 +0000
committerBernard Normier <bernard@zeroc.com>2004-04-19 21:44:50 +0000
commitc4fce53b0a51b4b6df57758a01f213129716a94c (patch)
tree984bbd3e845efe7c60261d940e12e3e542a99f4f /cpp/src
parentAdded keep, keepFacet, remove and removeFacet to Evictor; bug fixes (diff)
downloadice-c4fce53b0a51b4b6df57758a01f213129716a94c.tar.bz2
ice-c4fce53b0a51b4b6df57758a01f213129716a94c.tar.xz
ice-c4fce53b0a51b4b6df57758a01f213129716a94c.zip
Windows build fixes
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/IceUtil/CountDownLatch.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/cpp/src/IceUtil/CountDownLatch.cpp b/cpp/src/IceUtil/CountDownLatch.cpp
index 6e1f37d8646..41a9d60abe6 100644
--- a/cpp/src/IceUtil/CountDownLatch.cpp
+++ b/cpp/src/IceUtil/CountDownLatch.cpp
@@ -49,8 +49,7 @@ void
IceUtil::CountDownLatch::await() const
{
#ifdef _WIN32
- int* countPtr = const_cast<int*>(&_count);
- while(InterlockedCompareExchange(countPtr, 0, 0) > 0)
+ while(InterlockedExchangeAdd(&_count, 0) > 0)
{
DWORD rc = WaitForSingleObject(_event, INFINITE);
assert(rc == WAIT_OBJECT_0 || rc == WAIT_FAILED);
@@ -113,8 +112,7 @@ int
IceUtil::CountDownLatch::getCount() const
{
#ifdef _WIN32
- int* countPtr = const_cast<int*>(&_count);
- int count = InterlockedCompareExchange(countPtr, 0, 0);
+ int count = InterlockedExchangeAdd(&_count, 0);
return count > 0 ? count : 0;
#else
lock();