winecoreaudio: Fix race to open.
commit00e99963398ae0f46f25fc6cc541e37958ab1224
authorKen Thomases <ken@codeweavers.com>
Wed, 24 May 2006 10:27:24 +0000 (24 05:27 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 1 Jun 2006 10:50:46 +0000 (1 12:50 +0200)
treecd681158f5088f18f6bf3da31b3ffe8cb6383db6
parent7f98594f75823057aedb6ece689921d301882ac9
winecoreaudio: Fix race to open.

Fixes a race condition (noted in a comment for wodOpen) when multiple
threads try to open the same wave-out device simultaneously.
Addressed by creating the device mutexes when the driver is
initialized, instead of as each device is opened.  Then use the mutex
to protect the open operation against races.  At the same time, made
the mutexes recursive to avoid self-deadlocks the driver was
encountering when reentered from the callback.
dlls/winmm/winecoreaudio/audio.c