diff options
author | Jose <jose@zeroc.com> | 2012-12-27 23:20:00 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-12-27 23:20:00 +0100 |
commit | 05fe914f6f78c8f7bb3f4530d68b2926bf2cea51 (patch) | |
tree | f171ab75496f6dc5e5b2cec5e92f8a46049e9a1d /cpp/src/IceUtil/RecMutex.cpp | |
parent | Fixed (ICE-5161) - Strange xxx ruby library names (diff) | |
download | ice-05fe914f6f78c8f7bb3f4530d68b2926bf2cea51.tar.bz2 ice-05fe914f6f78c8f7bb3f4530d68b2926bf2cea51.tar.xz ice-05fe914f6f78c8f7bb3f4530d68b2926bf2cea51.zip |
Fixed warnings related to ICE-5157
Diffstat (limited to 'cpp/src/IceUtil/RecMutex.cpp')
-rw-r--r-- | cpp/src/IceUtil/RecMutex.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/IceUtil/RecMutex.cpp b/cpp/src/IceUtil/RecMutex.cpp index 46209f55bc6..6a3f54a55eb 100644 --- a/cpp/src/IceUtil/RecMutex.cpp +++ b/cpp/src/IceUtil/RecMutex.cpp @@ -168,9 +168,13 @@ IceUtil::RecMutex::init(const MutexProtocol protocol) IceUtil::RecMutex::~RecMutex() { assert(_count == 0); +#ifndef NDEBUG int rc = 0; rc = pthread_mutex_destroy(&_mutex); assert(rc == 0); +#else + pthread_mutex_destroy(&_mutex); +#endif } void @@ -216,9 +220,12 @@ IceUtil::RecMutex::unlock() const { if(--_count == 0) { - int rc = 0; // Prevent warnings when NDEBUG is defined. - rc = pthread_mutex_unlock(&_mutex); +#ifndef NDEBUG + int rc = pthread_mutex_unlock(&_mutex); assert(rc == 0); +#else + pthread_mutex_unlock(&_mutex); +#endif } } |