aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index e89b459f..59237b0b 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -680,7 +680,7 @@ static const ALchar alExtList[] =
static volatile ALCenum LastNullDeviceError = ALC_NO_ERROR;
/* Thread-local current context */
-static pthread_key_t LocalContext;
+static althread_key_t LocalContext;
/* Process-wide current context */
static ALCcontext *volatile GlobalContext = NULL;
@@ -698,7 +698,7 @@ enum LogLevel LogLevel = LogError;
static ALCboolean TrapALCError = ALC_FALSE;
/* One-time configuration init control */
-static pthread_once_t alc_config_once = PTHREAD_ONCE_INIT;
+static althread_once_t alc_config_once = ALTHREAD_ONCE_INIT;
/* Default effect that applies to sources that don't have an effect on send 0 */
static ALeffect DefaultEffect;
@@ -768,7 +768,7 @@ BOOL APIENTRY DllMain(HINSTANCE hModule,DWORD ul_reason_for_call,LPVOID lpReserv
LockUIntMapRead(&TlsDestructor);
for(i = 0;i < TlsDestructor.size;i++)
{
- void *ptr = pthread_getspecific(TlsDestructor.array[i].key);
+ void *ptr = althread_getspecific(TlsDestructor.array[i].key);
void (*callback)(void*) = (void(*)(void*))TlsDestructor.array[i].value;
if(ptr && callback)
callback(ptr);
@@ -833,7 +833,7 @@ static void alc_init(void)
if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
ZScale *= -1.0f;
- pthread_key_create(&LocalContext, ReleaseThreadCtx);
+ althread_key_create(&LocalContext, ReleaseThreadCtx);
InitializeCriticalSection(&ListLock);
ThunkInit();
}
@@ -1107,7 +1107,7 @@ static void alc_initconfig(void)
if((str && str[0]) || ConfigValueStr(NULL, "default-reverb", &str))
LoadReverbPreset(str, &DefaultEffect);
}
-#define DO_INITCONFIG() pthread_once(&alc_config_once, alc_initconfig)
+#define DO_INITCONFIG() althread_once(&alc_config_once, alc_initconfig)
/************************************************
@@ -1148,7 +1148,7 @@ static void alc_deinit_safe(void)
ThunkExit();
DeleteCriticalSection(&ListLock);
- pthread_key_delete(LocalContext);
+ althread_key_delete(LocalContext);
if(LogFile != stderr)
fclose(LogFile);
@@ -2093,10 +2093,10 @@ static void ReleaseContext(ALCcontext *context, ALCdevice *device)
{
ALCcontext *volatile*tmp_ctx;
- if(pthread_getspecific(LocalContext) == context)
+ if(althread_getspecific(LocalContext) == context)
{
WARN("%p released while current on thread\n", context);
- pthread_setspecific(LocalContext, NULL);
+ althread_setspecific(LocalContext, NULL);
ALCcontext_DecRef(context);
}
@@ -2177,7 +2177,7 @@ ALCcontext *GetContextRef(void)
{
ALCcontext *context;
- context = pthread_getspecific(LocalContext);
+ context = althread_getspecific(LocalContext);
if(context)
ALCcontext_IncRef(context);
else
@@ -2746,7 +2746,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void)
{
ALCcontext *Context;
- Context = pthread_getspecific(LocalContext);
+ Context = althread_getspecific(LocalContext);
if(!Context) Context = GlobalContext;
return Context;
@@ -2759,7 +2759,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void)
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void)
{
ALCcontext *Context;
- Context = pthread_getspecific(LocalContext);
+ Context = althread_getspecific(LocalContext);
return Context;
}
@@ -2781,9 +2781,9 @@ ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context)
context = ExchangePtr((XchgPtr*)&GlobalContext, context);
if(context) ALCcontext_DecRef(context);
- if((context=pthread_getspecific(LocalContext)) != NULL)
+ if((context=althread_getspecific(LocalContext)) != NULL)
{
- pthread_setspecific(LocalContext, NULL);
+ althread_setspecific(LocalContext, NULL);
ALCcontext_DecRef(context);
}
@@ -2805,8 +2805,8 @@ ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context)
return ALC_FALSE;
}
/* context's reference count is already incremented */
- old = pthread_getspecific(LocalContext);
- pthread_setspecific(LocalContext, context);
+ old = althread_getspecific(LocalContext);
+ althread_setspecific(LocalContext, context);
if(old) ALCcontext_DecRef(old);
return ALC_TRUE;