Browse Source

posix: Set mutex type to PTHREAD_MUTEX_ERRORCHECK

pull/613/head
fps 4 years ago
parent
commit
eceb678560
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      posix/JackPosixMutex.cpp

+ 4
- 1
posix/JackPosixMutex.cpp View File

@@ -28,7 +28,10 @@ namespace Jack
JackBasePosixMutex::JackBasePosixMutex(const char* name) JackBasePosixMutex::JackBasePosixMutex(const char* name)
:fOwner(0) :fOwner(0)
{ {
int res = pthread_mutex_init(&fMutex, NULL);
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
int res = pthread_mutex_init(&fMutex, &attr);
ThrowIf(res != 0, JackException("JackBasePosixMutex: could not init the mutex")); ThrowIf(res != 0, JackException("JackBasePosixMutex: could not init the mutex"));
} }




Loading…
Cancel
Save