3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
* Copyright (C) 2005 - 2007 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
53 |
pthread_mutexattr_init(&__posix_mutexattr); |
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) || defined(__APPLE__) |
57 |
|
// Mac OS X Note: 10.4 (and later) does support PTHREAD_MUTEX_ERRORCHECK, and |
58 |
|
// actually LinuxSampler does not work if this call is omitted. However, |
59 |
|
// defining _XOPEN_SOURCE macro seems to cause other problems. As a workaround, |
60 |
|
// the symbol __APPLE__ is checked here. There should be a better solution |
61 |
|
// to this problem. (Toshi Nagata, 27 Mar 2007) |
62 |
if (pthread_mutexattr_settype(&__posix_mutexattr, PTHREAD_MUTEX_ERRORCHECK)) { |
if (pthread_mutexattr_settype(&__posix_mutexattr, PTHREAD_MUTEX_ERRORCHECK)) { |
63 |
std::cout << "Mutex Constructor: Fatal error - unable to pthread_mutexattr_settype(PTHREAD_MUTEX_ERRORCHECK)\n" << std::flush; |
std::cout << "Mutex Constructor: Fatal error - unable to pthread_mutexattr_settype(PTHREAD_MUTEX_ERRORCHECK)\n" << std::flush; |
64 |
exit(-1); |
exit(-1); |