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