dsound: Use TIME_KILL_SYNCHRONOUS on sound timer.
Maarten Lankhorst
m.b.lankhorst at gmail.com
Wed Jun 13 09:27:58 CDT 2007
Removes a Sleep();
-------------- next part --------------
>From a97e52d44883e6f8bd90ac1954207fbb36e1a7c7 Mon Sep 17 00:00:00 2001
From: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Wed, 13 Jun 2007 14:12:07 +0200
Subject: [PATCH] dsound: Use TIME_KILL_SYNCHRONOUS on timer
---
dlls/dsound/dsound.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 2a72027..9680930 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -1249,10 +1249,8 @@ ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
int i;
timeKillEvent(device->timerID);
timeEndPeriod(DS_TIME_RES);
- /* wait for timer to expire */
- Sleep(DS_TIME_RES+1);
- /* The sleep above should have allowed the timer process to expire
+ /* The kill event should have allowed the timer process to expire
* but try to grab the lock just in case. Can't hold lock because
* IDirectSoundBufferImpl_Destroy also grabs the lock */
RtlAcquireResourceShared(&(device->buffer_list_lock), TRUE);
@@ -1521,7 +1519,7 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG
DSOUND_renderer[device->drvdesc.dnDevNode] = device;
timeBeginPeriod(DS_TIME_RES);
DSOUND_renderer[device->drvdesc.dnDevNode]->timerID = timeSetEvent(DS_TIME_DEL, DS_TIME_RES, DSOUND_timer,
- (DWORD_PTR)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
+ (DWORD_PTR)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION | TIME_KILL_SYNCHRONOUS);
} else {
WARN("DSOUND_PrimaryCreate failed\n");
}
--
1.4.4.2
More information about the wine-patches
mailing list