@@ -37,12 +37,12 @@ public: | |||||
/* | /* | ||||
* Constructor. | * Constructor. | ||||
*/ | */ | ||||
Mutex() noexcept | |||||
Mutex(bool inheritPriority = true) noexcept | |||||
: fMutex() | : fMutex() | ||||
{ | { | ||||
pthread_mutexattr_t atts; | pthread_mutexattr_t atts; | ||||
pthread_mutexattr_init(&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_mutexattr_settype(&atts, PTHREAD_MUTEX_NORMAL); | ||||
pthread_mutex_init(&fMutex, &atts); | pthread_mutex_init(&fMutex, &atts); | ||||
pthread_mutexattr_destroy(&atts); | pthread_mutexattr_destroy(&atts); | ||||
@@ -37,7 +37,7 @@ protected: | |||||
* Constructor. | * Constructor. | ||||
*/ | */ | ||||
Thread(const char* const threadName = nullptr) noexcept | Thread(const char* const threadName = nullptr) noexcept | ||||
: fLock(), | |||||
: fLock(false), | |||||
fName(threadName), | fName(threadName), | ||||
#ifdef PTW32_DLLPORT | #ifdef PTW32_DLLPORT | ||||
fHandle({nullptr, 0}), | fHandle({nullptr, 0}), | ||||
@@ -189,7 +189,7 @@ static ZynAddSubFxPrograms sPrograms; | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
class MiddleWareThread : public CarlaThread | |||||
class MiddleWareThread : private CarlaThread | |||||
{ | { | ||||
public: | public: | ||||
class ScopedStopper | class ScopedStopper | ||||
@@ -31,13 +31,13 @@ public: | |||||
/* | /* | ||||
* Constructor. | * Constructor. | ||||
*/ | */ | ||||
CarlaMutex() noexcept | |||||
CarlaMutex(const bool inheritPriority = true) noexcept | |||||
: fMutex(), | : fMutex(), | ||||
fTryLockWasCalled(false) | fTryLockWasCalled(false) | ||||
{ | { | ||||
pthread_mutexattr_t atts; | pthread_mutexattr_t atts; | ||||
pthread_mutexattr_init(&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_mutexattr_settype(&atts, PTHREAD_MUTEX_NORMAL); | ||||
pthread_mutex_init(&fMutex, &atts); | pthread_mutex_init(&fMutex, &atts); | ||||
pthread_mutexattr_destroy(&atts); | pthread_mutexattr_destroy(&atts); | ||||
@@ -35,7 +35,7 @@ protected: | |||||
* Constructor. | * Constructor. | ||||
*/ | */ | ||||
CarlaThread(const char* const threadName = nullptr) noexcept | CarlaThread(const char* const threadName = nullptr) noexcept | ||||
: fLock(), | |||||
: fLock(false), | |||||
fName(threadName), | fName(threadName), | ||||
#ifdef PTW32_DLLPORT | #ifdef PTW32_DLLPORT | ||||
fHandle({nullptr, 0}), | fHandle({nullptr, 0}), | ||||