Browse Source

Make PTHREAD_PRIO_INHERIT optional

pull/6/head
falkTX 9 years ago
parent
commit
ba4e240464
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      distrho/extra/Mutex.hpp
  2. +1
    -1
      distrho/extra/Thread.hpp

+ 2
- 2
distrho/extra/Mutex.hpp View File

@@ -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);


+ 1
- 1
distrho/extra/Thread.hpp View File

@@ -37,7 +37,7 @@ protected:
* Constructor.
*/
Thread(const char* const threadName = nullptr) noexcept
: fLock(),
: fLock(false),
fName(threadName),
#ifdef PTW32_DLLPORT
fHandle({nullptr, 0}),


Loading…
Cancel
Save