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