From a39e423f6f6d2d61eb4bdc052d2ea2ab219325e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20H=C3=B6hle?= Date: Sun, 9 Dec 2012 22:56:40 +0100 Subject: [PATCH] mmdevapi: Avoid lock contention after SetEvent. --- dlls/winealsa.drv/mmdevdrv.c | 6 +++--- dlls/wineoss.drv/mmdevdrv.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 3e8ad8d20a0..8c905e9b1a3 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -2137,12 +2137,12 @@ static void CALLBACK alsa_push_buffer_data(void *user, BOOLEAN timer) alsa_write_data(This); else if(This->dataflow == eCapture) alsa_read_data(This); - - if(This->event) - SetEvent(This->event); } LeaveCriticalSection(&This->lock); + + if(This->event) + SetEvent(This->event); } static HRESULT WINAPI AudioClient_Start(IAudioClient *iface) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 4de5ae6bbab..ea6d4520b40 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -1481,12 +1481,12 @@ static void CALLBACK oss_period_callback(void *user, BOOLEAN timer) oss_write_data(This); else if(This->dataflow == eCapture) oss_read_data(This); - - if(This->event) - SetEvent(This->event); } LeaveCriticalSection(&This->lock); + + if(This->event) + SetEvent(This->event); } static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)