aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/null.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-16 06:11:40 -0700
committerChris Robinson <[email protected]>2014-04-16 06:11:40 -0700
commitd124aee4d78db389117a8eda60c12a829489622b (patch)
tree71b50e2e25b8089088ce46fd8bfd045a3e5451d3 /Alc/backends/null.c
parent505ef82246d608970e291289c1087ed42f444281 (diff)
Remove the old thread wrappers for the new ones
Diffstat (limited to 'Alc/backends/null.c')
-rw-r--r--Alc/backends/null.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/backends/null.c b/Alc/backends/null.c
index 6b59ef7a..4a3aa2d2 100644
--- a/Alc/backends/null.c
+++ b/Alc/backends/null.c
@@ -37,11 +37,11 @@ typedef struct ALCnullBackend {
DERIVE_FROM_TYPE(ALCbackend);
volatile int killNow;
- althread_t thread;
+ althrd_t thread;
} ALCnullBackend;
DECLARE_ALCBACKEND_VTABLE(ALCnullBackend);
-static ALuint ALCnullBackend_mixerProc(ALvoid *ptr);
+static int ALCnullBackend_mixerProc(void *ptr);
static void ALCnullBackend_Construct(ALCnullBackend *self, ALCdevice *device);
static DECLARE_FORWARD(ALCnullBackend, ALCbackend, void, Destruct)
@@ -68,7 +68,7 @@ static void ALCnullBackend_Construct(ALCnullBackend *self, ALCdevice *device)
}
-static ALuint ALCnullBackend_mixerProc(ALvoid *ptr)
+static int ALCnullBackend_mixerProc(void *ptr)
{
ALCnullBackend *self = (ALCnullBackend*)ptr;
ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice;
@@ -137,21 +137,21 @@ static ALCboolean ALCnullBackend_reset(ALCnullBackend *self)
static ALCboolean ALCnullBackend_start(ALCnullBackend *self)
{
- if(!StartThread(&self->thread, ALCnullBackend_mixerProc, self))
+ self->killNow = 0;
+ if(althrd_create(&self->thread, ALCnullBackend_mixerProc, self) != althrd_success)
return ALC_FALSE;
return ALC_TRUE;
}
static void ALCnullBackend_stop(ALCnullBackend *self)
{
- if(!self->thread)
+ int res;
+
+ if(self->killNow)
return;
self->killNow = 1;
- StopThread(self->thread);
- self->thread = NULL;
-
- self->killNow = 0;
+ althrd_join(self->thread, &res);
}
DEFINE_ALCBACKEND_VTABLE(ALCnullBackend);