commit ba4e24046493f754dcf32386102a8f6e50e7268c
parent fd34de63e4781ea0660a4691f33799ac89935fd7
Author: falkTX <falktx@gmail.com>
Date: Sat, 12 Mar 2016 10:40:54 +0100
Make PTHREAD_PRIO_INHERIT optional
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git 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
@@ -37,7 +37,7 @@ protected:
* Constructor.
*/
Thread(const char* const threadName = nullptr) noexcept
- : fLock(),
+ : fLock(false),
fName(threadName),
#ifdef PTW32_DLLPORT
fHandle({nullptr, 0}),