summaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-29 03:08:26 -0700
committerChris Robinson <[email protected]>2011-05-29 03:08:26 -0700
commit2bbe9d1b1f2fe4b866f025eb268c5421342cba9a (patch)
treec2f73176824456b25856184aee0ce4a7bebc3f8a /Alc/ALc.c
parent91c3cffe419befc6d77f1b194fbf9165de7d6f19 (diff)
Uninline a couple mutex wrapper functions
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index cc3a93a4..f3dcee39 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1022,6 +1022,36 @@ ALboolean IsValidChannels(ALenum channels)
return AL_FALSE;
}
+
+#ifndef _WIN32
+void InitializeCriticalSection(CRITICAL_SECTION *cs)
+{
+ pthread_mutexattr_t attrib;
+ int ret;
+
+ ret = pthread_mutexattr_init(&attrib);
+ 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);
+
+ pthread_mutexattr_destroy(&attrib);
+}
+void DeleteCriticalSection(CRITICAL_SECTION *cs)
+{
+ int ret;
+ ret = pthread_mutex_destroy(cs);
+ assert(ret == 0);
+}
+#endif
+
+
static void LockLists(void)
{
EnterCriticalSection(&ListLock);