diff options
author | Chris Robinson <[email protected]> | 2014-04-16 06:11:40 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-04-16 06:11:40 -0700 |
commit | d124aee4d78db389117a8eda60c12a829489622b (patch) | |
tree | 71b50e2e25b8089088ce46fd8bfd045a3e5451d3 /Alc/backends/dsound.c | |
parent | 505ef82246d608970e291289c1087ed42f444281 (diff) |
Remove the old thread wrappers for the new ones
Diffstat (limited to 'Alc/backends/dsound.c')
-rw-r--r-- | Alc/backends/dsound.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c index f6846791..ac97e54d 100644 --- a/Alc/backends/dsound.c +++ b/Alc/backends/dsound.c @@ -77,7 +77,7 @@ typedef struct { HANDLE NotifyEvent; volatile int killNow; - althread_t thread; + althrd_t thread; } DSoundPlaybackData; typedef struct { @@ -180,7 +180,7 @@ static BOOL CALLBACK DSoundEnumDevices(LPGUID guid, LPCWSTR desc, LPCWSTR UNUSED } -FORCE_ALIGN static ALuint DSoundPlaybackProc(ALvoid *ptr) +FORCE_ALIGN static int DSoundPlaybackProc(void *ptr) { ALCdevice *Device = (ALCdevice*)ptr; DSoundPlaybackData *data = (DSoundPlaybackData*)Device->ExtraData; @@ -596,7 +596,8 @@ static ALCboolean DSoundStartPlayback(ALCdevice *device) { DSoundPlaybackData *data = (DSoundPlaybackData*)device->ExtraData; - if(!StartThread(&data->thread, DSoundPlaybackProc, device)) + data->killNow = 0; + if(althrd_create(&data->thread, DSoundPlaybackProc, device) != althrd_success) return ALC_FALSE; return ALC_TRUE; @@ -605,15 +606,14 @@ static ALCboolean DSoundStartPlayback(ALCdevice *device) static void DSoundStopPlayback(ALCdevice *device) { DSoundPlaybackData *data = device->ExtraData; + int res; - if(!data->thread) + if(data->killNow) return; data->killNow = 1; - StopThread(data->thread); - data->thread = NULL; + althrd_join(data->thread, &res); - data->killNow = 0; IDirectSoundBuffer_Stop(data->Buffer); } |