http://bugs.winehq.org/show_bug.cgi?id=29531
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #39263|0 |1 is obsolete| |
--- Comment #12 from Jörg Höhle hoehle@users.sourceforge.net 2012-12-18 14:41:01 CST --- Created attachment 42845 --> http://bugs.winehq.org/attachment.cgi?id=42845 lock-free patch incl. full memory barriers
I had an oversight: the audio buffer itself is R/W too ;-P
So now I'm using the InterlockedExchangeAdd(&,0) pattern to obtain a full memory barrier at entry of the callbacks (and IEA(&,delta) is used at exit).
I'm still looking for an on-the-fly read-only pattern. For instance, InterlockedExchangeAdd is not nice within GetPosition. That function should simply take an atomic snapshot of This->held_frames. Similarly, MCIMIDI wants the read-only pattern, the MIDI data is fixed while playing.
The attached patch requires my patch "Separate read and write pointers" from http://www.winehq.org/pipermail/wine-patches/2012-December/120834.html (or from my previous comment ?)