diff options
author | Marc Laukien <marc@zeroc.com> | 2003-02-23 20:46:58 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-02-23 20:46:58 +0000 |
commit | 82bd27651fad5f5a47b7982a3a5e31f784601992 (patch) | |
tree | 7dcac39d663e5894a17665bfb2e2f48ad50b4e26 /cpp/src/IceUtil/RecMutex.cpp | |
parent | Updated makecerts to copy pertinent certificates to the test directory on (diff) | |
download | ice-82bd27651fad5f5a47b7982a3a5e31f784601992.tar.bz2 ice-82bd27651fad5f5a47b7982a3a5e31f784601992.tar.xz ice-82bd27651fad5f5a47b7982a3a5e31f784601992.zip |
RecMutex init
Diffstat (limited to 'cpp/src/IceUtil/RecMutex.cpp')
-rw-r--r-- | cpp/src/IceUtil/RecMutex.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cpp/src/IceUtil/RecMutex.cpp b/cpp/src/IceUtil/RecMutex.cpp index ae83312043c..7e0431fe89d 100644 --- a/cpp/src/IceUtil/RecMutex.cpp +++ b/cpp/src/IceUtil/RecMutex.cpp @@ -88,6 +88,26 @@ IceUtil::RecMutex::lock(LockState& state) const IceUtil::RecMutex::RecMutex() : _count(0) { + pthread_mutexattr_t attr; + int rc = pthread_mutexattr_init(&attr); + if(rc != 0) + { + throw ThreadSyscallException(__FILE__, __LINE__); + } + + rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + if(rc != 0) + { + throw ThreadSyscallException(__FILE__, __LINE__); + } + + rc = pthread_mutex_init(&_mutex, &attr); + if(rc != 0) + { + throw ThreadSyscallException(__FILE__, __LINE__); + } + +/* #ifdef __linux__ const pthread_mutexattr_t attr = { PTHREAD_MUTEX_RECURSIVE_NP }; #else @@ -99,6 +119,7 @@ IceUtil::RecMutex::RecMutex() : { throw ThreadSyscallException(__FILE__, __LINE__); } +*/ } IceUtil::RecMutex::~RecMutex() |