dsound: Wait on thread handle instead of dedicated event in DirectSoundDevice_Release.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
158a2c96cc
commit
e8fd1c73b2
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue