From ba4e24046493f754dcf32386102a8f6e50e7268c Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 12 Mar 2016 10:41:20 +0100 Subject: [PATCH] Make PTHREAD_PRIO_INHERIT optional --- distrho/extra/Mutex.hpp | 4 ++-- distrho/extra/Thread.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/distrho/extra/Mutex.hpp b/distrho/extra/Mutex.hpp index ea5cc004..14a5c6e6 100644 --- a/distrho/extra/Mutex.hpp +++ b/distrho/extra/Mutex.hpp @@ -37,12 +37,12 @@ public: /* * Constructor. */ - Mutex() noexcept + Mutex(bool inheritPriority = true) noexcept : fMutex() { pthread_mutexattr_t atts; pthread_mutexattr_init(&atts); - pthread_mutexattr_setprotocol(&atts, PTHREAD_PRIO_INHERIT); + pthread_mutexattr_setprotocol(&atts, inheritPriority ? PTHREAD_PRIO_INHERIT : PTHREAD_PRIO_NONE); pthread_mutexattr_settype(&atts, PTHREAD_MUTEX_NORMAL); pthread_mutex_init(&fMutex, &atts); pthread_mutexattr_destroy(&atts); diff --git a/distrho/extra/Thread.hpp b/distrho/extra/Thread.hpp index f2abb767..0352c344 100644 --- a/distrho/extra/Thread.hpp +++ b/distrho/extra/Thread.hpp @@ -37,7 +37,7 @@ protected: * Constructor. */ Thread(const char* const threadName = nullptr) noexcept - : fLock(), + : fLock(false), fName(threadName), #ifdef PTW32_DLLPORT fHandle({nullptr, 0}),