CVS: winex/dlls/winmm/winealsa audio.c,1.47,1.48

[email protected]
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/dlls/winmm/winealsa audio.c,1.47,1.48Update of /var/lib/cvsd/cvsroot/winex/dlls/winmm/winealsa
In directory agravaine:/tmp/cvs-serv24890/dlls/winmm/winealsa

Modified Files:
	audio.c 
Log Message:
Figured can't hurt to make the locking I just added a bit more race-free.
(Probably should have done it before my last checkin, but...)


Index: audio.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/winmm/winealsa/audio.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- audio.c	30 Mar 2007 21:34:31 -0000	1.47
+++ audio.c	30 Mar 2007 21:35:00 -0000	1.48
@@ -2187,17 +2187,17 @@
     /* snd_pcm_t *               handle = snd_async_handler_get_pcm(ahandler); */
     IDsDriverBufferImpl*      pdbi = snd_async_handler_get_callback_private(ahandler);
     TRACE("callback called\n");
+    InterlockedIncrement(&pdbi->mmap_copy_pending);
     /* try to acquire critical section (must not block) */
     if (!TryEnterCriticalSection(&pdbi->mmap_crst)) {
-        InterlockedIncrement(&pdbi->mmap_copy_pending);
         return;
     }
     /* don't accept a recursive lock, it means we interrupted something */
     if (pdbi->mmap_crst.RecursionCount > 1) {
-        InterlockedIncrement(&pdbi->mmap_copy_pending);
         LeaveCriticalSection(&pdbi->mmap_crst);
         return;
     }
+    InterlockedExchange(&pdbi->mmap_copy_pending, 0);
     DSDB_MMAPCopy(pdbi);
     LeaveCriticalSection(&pdbi->mmap_crst);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.