Browse Source

Make PTHREAD_PRIO_INHERIT optional (fixes #375, please test)

tags/1.9.7
falkTX 9 years ago
parent
commit
a9b49d450a
5 changed files with 7 additions and 7 deletions
  1. +2
    -2
      source/modules/distrho/extra/Mutex.hpp
  2. +1
    -1
      source/modules/distrho/extra/Thread.hpp
  3. +1
    -1
      source/native-plugins/zynaddsubfx-synth.cpp
  4. +2
    -2
      source/utils/CarlaMutex.hpp
  5. +1
    -1
      source/utils/CarlaThread.hpp

+ 2
- 2
source/modules/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
source/modules/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}),


+ 1
- 1
source/native-plugins/zynaddsubfx-synth.cpp View File

@@ -189,7 +189,7 @@ static ZynAddSubFxPrograms sPrograms;

// -----------------------------------------------------------------------

class MiddleWareThread : public CarlaThread
class MiddleWareThread : private CarlaThread
{
public:
class ScopedStopper


+ 2
- 2
source/utils/CarlaMutex.hpp View File

@@ -31,13 +31,13 @@ public:
/*
* Constructor.
*/
CarlaMutex() noexcept
CarlaMutex(const bool inheritPriority = true) noexcept
: fMutex(),
fTryLockWasCalled(false)
{
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
source/utils/CarlaThread.hpp View File

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


Loading…
Cancel
Save