summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/RecMutex.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2012-08-09 15:40:44 -0400
committerBernard Normier <bernard@zeroc.com>2012-08-09 15:40:44 -0400
commit87ae1f009ce03d18e459ad8d66050da9a9f63144 (patch)
tree40118e7d5f3ce44688de309d6c8c4e13a26b6ac3 /cpp/src/IceUtil/RecMutex.cpp
parentWinRT Endpoint fixes for encoding11 (diff)
downloadice-87ae1f009ce03d18e459ad8d66050da9a9f63144.tar.bz2
ice-87ae1f009ce03d18e459ad8d66050da9a9f63144.tar.xz
ice-87ae1f009ce03d18e459ad8d66050da9a9f63144.zip
Added native cond-var implementation on Windows (bug #2667)
for Visual Studio 2012 and up Removed all #define and checks for _WIN32_WINNT (no longer needed) Misc build fixes for Visual Studio IceUtil/Config.h cleanup (minor)
Diffstat (limited to 'cpp/src/IceUtil/RecMutex.cpp')
-rw-r--r--cpp/src/IceUtil/RecMutex.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/IceUtil/RecMutex.cpp b/cpp/src/IceUtil/RecMutex.cpp
index 9558a6fed2b..46209f55bc6 100644
--- a/cpp/src/IceUtil/RecMutex.cpp
+++ b/cpp/src/IceUtil/RecMutex.cpp
@@ -79,6 +79,21 @@ IceUtil::RecMutex::unlock() const
}
}
+# ifdef ICE_HAS_WIN32_CONDVAR
+void
+IceUtil::RecMutex::unlock(LockState& state) const
+{
+ state.mutex = &_mutex;
+ state.count = _count;
+ _count = 0;
+}
+
+void
+IceUtil::RecMutex::lock(LockState& state) const
+{
+ _count = state.count;
+}
+# else
void
IceUtil::RecMutex::unlock(LockState& state) const
{
@@ -93,6 +108,7 @@ IceUtil::RecMutex::lock(LockState& state) const
EnterCriticalSection(&_mutex);
_count = state.count;
}
+# endif
#else