50 |
namespace LinuxSampler { |
namespace LinuxSampler { |
51 |
|
|
52 |
Mutex::Mutex() { |
Mutex::Mutex() { |
53 |
|
pthread_mutexattr_init(&__posix_mutexattr); |
54 |
|
|
55 |
// the following function call only works on UNIX98 compatible systems |
// the following function call only works on UNIX98 compatible systems |
56 |
#if (_XOPEN_SOURCE > 500) |
#if (_XOPEN_SOURCE > 500) |
57 |
if (pthread_mutexattr_settype(&__posix_mutexattr, PTHREAD_MUTEX_ERRORCHECK)) { |
if (pthread_mutexattr_settype(&__posix_mutexattr, PTHREAD_MUTEX_ERRORCHECK)) { |
64 |
|
|
65 |
Mutex::~Mutex() { |
Mutex::~Mutex() { |
66 |
pthread_mutex_destroy(&__posix_mutex); |
pthread_mutex_destroy(&__posix_mutex); |
67 |
|
pthread_mutexattr_destroy(&__posix_mutexattr); |
68 |
} |
} |
69 |
|
|
70 |
void Mutex::Lock() { |
void Mutex::Lock() { |