aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-16 08:00:54 -0700
committerChris Robinson <[email protected]>2014-04-16 08:00:54 -0700
commit2149ccd985427e1ad0db6d8e3e3769a1370f92f9 (patch)
tree226d12868373190e467e5a1f5b38d87a79ea7b2e
parentc6dd4792292194589a535da703c4a3efd10eb6c8 (diff)
Remove almtx_normal and almtx_errorcheck
-rw-r--r--Alc/threads.c21
-rw-r--r--OpenAL32/Include/threads.h4
2 files changed, 8 insertions, 17 deletions
diff --git a/Alc/threads.c b/Alc/threads.c
index cfc8b9e8..5361e649 100644
--- a/Alc/threads.c
+++ b/Alc/threads.c
@@ -155,8 +155,9 @@ int althrd_sleep(const struct timespec *ts, struct timespec* UNUSED(rem))
int almtx_init(almtx_t *mtx, int type)
{
if(!mtx) return althrd_error;
- type &= ~(almtx_recursive|almtx_timed|almtx_normal|almtx_errorcheck);
- if(type != 0) return althrd_error;
+ type &= ~(almtx_recursive|almtx_timed);
+ if(type != almtx_plain)
+ return althrd_error;
InitializeCriticalSection(mtx);
return althrd_success;
@@ -293,7 +294,7 @@ int almtx_init(almtx_t *mtx, int type)
int ret;
if(!mtx) return althrd_error;
- if((type&~(almtx_normal|almtx_recursive|almtx_timed|almtx_errorcheck)) != 0)
+ if((type&~(almtx_recursive|almtx_timed)) != 0)
return althrd_error;
type &= ~almtx_timed;
@@ -306,24 +307,16 @@ int almtx_init(almtx_t *mtx, int type)
ret = pthread_mutexattr_init(&attr);
if(ret) return althrd_error;
- switch(type)
+ if(type == almtx_recursive)
{
- case almtx_normal:
- ret = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
- break;
- case almtx_recursive:
ret = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#ifdef HAVE_PTHREAD_NP_H
if(ret != 0)
ret = pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE);
#endif
- break;
- case almtx_errorcheck:
- ret = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
- break;
- default:
- ret = 1;
}
+ else
+ ret = 1;
if(ret == 0)
ret = pthread_mutex_init(mtx, &attr);
pthread_mutexattr_destroy(&attr);
diff --git a/OpenAL32/Include/threads.h b/OpenAL32/Include/threads.h
index 943ef045..847ade7f 100644
--- a/OpenAL32/Include/threads.h
+++ b/OpenAL32/Include/threads.h
@@ -15,9 +15,7 @@ enum {
enum {
almtx_plain = 0,
almtx_recursive = 1,
- almtx_timed = 2,
- almtx_normal = 4,
- almtx_errorcheck = 8
+ almtx_timed = 2
};