From dd0ee61a02a9cb1a6ced0f6a4b0dd764a4cc99af Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 14 May 2008 10:59:07 +0000 Subject: [PATCH] Fix JackMutex constructor. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2258 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 1 + common/JackMutex.h | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0aa2d22..4a55eb73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,7 @@ Fernando Lopez-Lezcano 2008-05-13 Stephane Letz * Fix exception handling in JackShmMem::operator new. + * Fix JackMutex constructor. 2008-05-12 Stephane Letz diff --git a/common/JackMutex.h b/common/JackMutex.h index 9d96e157..13b4c7b5 100644 --- a/common/JackMutex.h +++ b/common/JackMutex.h @@ -81,9 +81,15 @@ class JackMutex { // Use recursive mutex pthread_mutexattr_t mutex_attr; - assert(pthread_mutexattr_init(&mutex_attr) == 0); - assert(pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE) == 0); - assert(pthread_mutex_init(&fMutex, &mutex_attr) == 0); + int res; + res = pthread_mutexattr_init(&mutex_attr); + assert(res == 0); + res = pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); + assert(res == 0); + res = pthread_mutex_init(&fMutex, &mutex_attr); + assert(res == 0); + pthread_mutexattr_destroy(&mutex_attr); + assert(res == 0); } virtual ~JackMutex() {