summaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-05-15 21:35:51 -0700
committerChris Robinson <[email protected]>2008-05-15 21:35:51 -0700
commitcad9b367a51f3efaefa666d68379fb21e1352678 (patch)
tree6a3b8d0e6847a0c865236fab0c6952a07167416e /OpenAL32
parent6e86146a25a629cd5f189a2aaa803d0c34a970e4 (diff)
Use pthread_mutexattr_setkind_np as a fallback to set a recursive mutex type
Some systems (FreeBSD) don't like setting it through pthread_mutexattr_settype
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 98d84a18..6bc5fd48 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -17,6 +17,9 @@
#include <assert.h>
#include <pthread.h>
+#ifdef HAVE_PTHREAD_NP_H
+#include <pthread_np.h>
+#endif
#include <sys/time.h>
#include <time.h>
#include <errno.h>
@@ -45,6 +48,10 @@ static inline void InitializeCriticalSection(CRITICAL_SECTION *cs)
assert(ret == 0);
ret = pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_RECURSIVE);
+#ifdef HAVE_PTHREAD_NP_H
+ if(ret != 0)
+ ret = pthread_mutexattr_setkind_np(&attrib, PTHREAD_MUTEX_RECURSIVE);
+#endif
assert(ret == 0);
ret = pthread_mutex_init(cs, &attrib);
assert(ret == 0);