http://bugs.winehq.org/show_bug.cgi?id=28464
--- Comment #3 from Jörg Höhle hoehle@users.sourceforge.net 2011-09-22 14:34:56 CDT --- Sorry, I see better investments of my time. I'd rather add GetPosition, WHDR_BEGIN/ENDLOOP and waveOutRestart tests to winmm/tests/wave.c
The log file is there, and my explanation of the behaviour logical, with one fault: at the time the second threads kicks in, there need not be more buffers marked done, having >1 buffers marked done initially is enough. The first thread returns device->first, and the second device->oldfirst->lpNext, so the second buffer is notified twice. That's exactly what the log shows: A9 is notified once, AB and AD twice.
Several things must occur concurrently to trigger the bug: - several buffers marked done and - waveOutWrite concurrent with feeder thread.
BTW, I already wrote 2/3 of a patch.