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}),