diff options
author | Peter Williams <peter@newton.cx> | 2015-12-19 21:07:37 -0500 |
---|---|---|
committer | Peter Williams <peter@newton.cx> | 2015-12-19 21:07:37 -0500 |
commit | cdaeaa825db191bd65aad3aaaeb3178738727f05 (patch) | |
tree | c03ba303bbc7d5137506a3c7714374669c0f1e8f | |
parent | 4394b0fbe5ab8cf59b9df552484cbae92d861adc (diff) | |
download | dbus-c++-cdaeaa825db191bd65aad3aaaeb3178738727f05.tar.gz |
src/eventloop.cpp: use portable method for initializing recursive mutex
-rw-r--r-- | src/eventloop.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/eventloop.cpp b/src/eventloop.cpp index 7fb06a3..f622812 100644 --- a/src/eventloop.cpp +++ b/src/eventloop.cpp @@ -85,8 +85,11 @@ DefaultMutex::DefaultMutex(bool recursive) { if (recursive) { - pthread_mutex_t recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; - _mutex = recmutex; + pthread_mutexattr_t attr; + + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&_mutex, &attr); } else { |