http://bugs.winehq.org/show_bug.cgi?id=29585
--- Comment #3 from Jörg Höhle hoehle@users.sourceforge.net 2012-01-23 04:35:05 CST --- The next improvement to winealsa and wineoss design: 9. Split use of the critical section This->lock a) One prevents several app threads from calling the API concurrently. b) The second one shall prevent the internal callback from operating on the slots that Get/ReleaseBuffer modify concurrently.
It is not good that bombarding the API with ReleaseBuffer(0) or GetCurrentPadding blocks the audio callback. Instead of an internal lock, we should investigate the opportunity for a lock-less design. Then, the kernel would never put the callback to sleep in EnterCriticalSection. What kernel expert knows how much later a thread recovers from such a sleep?