[dplayx] fix semaphore deadlock

Aric Cyr aric.cyr at gmail.com
Fri Mar 3 12:43:04 CST 2006


The following small patch allows Age of Empires III to start.  It
seems to load and unload dplayx.dll many times and was deadlocking on
when an error case occurred since the semaphore was not released.

Changelog:
- Make sure to release the dplayx semaphore in for error cases as well
- Prevent race condition between creation of the semaphore and grabbing
  of the lock by creating the semaphore in the locked state instead of unlocked
- reset static handles and pointers to NULL after freeing, just in case.

 dlls/dplayx/dplayx_global.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--
Aric Cyr <Aric.Cyr at gmail dot com>    (http://acyr.net)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-dplayx.diff
Type: text/x-patch
Size: 1733 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060304/4f5e3c8c/wine-dplayx.diff


More information about the wine-patches mailing list