From eceb678560815ee20b630f5f76583a330ea18b35 Mon Sep 17 00:00:00 2001 From: fps Date: Thu, 9 Jul 2020 07:25:22 +0200 Subject: [PATCH] posix: Set mutex type to PTHREAD_MUTEX_ERRORCHECK --- posix/JackPosixMutex.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posix/JackPosixMutex.cpp b/posix/JackPosixMutex.cpp index 72ecd8e64..be13f1c95 100644 --- a/posix/JackPosixMutex.cpp +++ b/posix/JackPosixMutex.cpp @@ -28,7 +28,10 @@ namespace Jack JackBasePosixMutex::JackBasePosixMutex(const char* name) :fOwner(0) { - int res = pthread_mutex_init(&fMutex, NULL); + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); + int res = pthread_mutex_init(&fMutex, &attr); ThrowIf(res != 0, JackException("JackBasePosixMutex: could not init the mutex")); }