mciavi: Prevent deadlock when closing while playing or when paused.

Joerg-Cyril.Hoehle at Joerg-Cyril.Hoehle at
Thu Mar 11 02:26:48 CST 2010


alas, even though mciavi contains lots of Critical Sections,
it's not enough to protect against 2 threads calling Play and Close
concurrently.  I believe something entirely different would be
needed: either a complete serialization of messages (like the OSS
and ALSA drivers), or a concept of transactions.

Also, I don't know whether or rather how much the MCI should protect
itself against concurrent access.
Of course it's nice to have, but every code section like this is IMHO broken:
 Enter CS(wma)
 Leave CS(wma) /* because the app may call back */
 Do something like sleep/wait or winmmXYZ or mciXYZ()
 Enter CS(wma) -- unsafe. anything might have happened since,
   wma might even be gone (close and FreeHeap) entirely.

 Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mciavi-Prevent-deadlock-when-closing-while-playing.patch
Type: application/octet-stream
Size: 1473 bytes
Desc: 0001-mciavi-Prevent-deadlock-when-closing-while-playing.patch
URL: <>

More information about the wine-patches mailing list