Jacek Caban : dsound: Wait on thread handle instead of dedicated event in DirectSoundDevice_Release.
Alexandre Julliard
julliard at winehq.org
Mon Nov 26 16:20:12 CST 2018
Module: wine
Branch: master
Commit: e8fd1c73b236b37cba8a9349d54c3ce3ee3aaacf
URL: https://source.winehq.org/git/wine.git/?a=commit;h=e8fd1c73b236b37cba8a9349d54c3ce3ee3aaacf
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Nov 22 20:24:08 2018 +0100
dsound: Wait on thread handle instead of dedicated event in DirectSoundDevice_Release.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dsound/dsound.c | 4 +---
dlls/dsound/dsound_private.h | 1 -
dlls/dsound/mixer.c | 1 -
3 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 12f1e28..71ede7d 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -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);
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index c045b38..45a100e 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -106,7 +106,6 @@ struct DirectSoundDevice
IAudioRenderClient *render;
HANDLE sleepev, thread;
- HANDLE thread_finished;
struct list entry;
};
diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index 9b3e730..32bde38 100644
--- a/dlls/dsound/mixer.c
+++ b/dlls/dsound/mixer.c
@@ -765,6 +765,5 @@ DWORD CALLBACK DSOUND_mixthread(void *p)
DSOUND_PerformMix(dev);
RtlReleaseResource(&(dev->buffer_list_lock));
}
- SetEvent(dev->thread_finished);
return 0;
}
More information about the wine-cvs
mailing list