Commit e8fd1c73 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

dsound: Wait on thread handle instead of dedicated event in DirectSoundDevice_Release.

parent 158a2c96
......@@ -203,9 +203,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
SetEvent(device->sleepev);
if (device->thread) {
WaitForSingleObject(device->thread_finished, INFINITE);
WaitForSingleObject(device->thread, INFINITE);
CloseHandle(device->thread);
CloseHandle(device->thread_finished);
}
EnterCriticalSection(&DSOUND_renderers_lock);
......@@ -383,7 +382,6 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU
ZeroMemory(&device->volpan, sizeof(device->volpan));
device->thread_finished = CreateEventW(0, 0, 0, 0);
device->thread = CreateThread(0, 0, DSOUND_mixthread, device, 0, 0);
SetThreadPriority(device->thread, THREAD_PRIORITY_TIME_CRITICAL);
......
......@@ -106,7 +106,6 @@ struct DirectSoundDevice
IAudioRenderClient *render;
HANDLE sleepev, thread;
HANDLE thread_finished;
struct list entry;
};
......
......@@ -765,6 +765,5 @@ DWORD CALLBACK DSOUND_mixthread(void *p)
DSOUND_PerformMix(dev);
RtlReleaseResource(&(dev->buffer_list_lock));
}
SetEvent(dev->thread_finished);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment