http://bugs.winehq.org/show_bug.cgi?id=21060
--- Comment #2 from Jörg Höhle hoehle@users.sourceforge.net 2010-04-28 09:20:43 --- Created an attachment (id=27598) --> (http://bugs.winehq.org/attachment.cgi?id=27598) bt all backtrace (from wine-1.1.31 due to bt all regression)
At first I thought there are 2 groups of mciavi bugs: - bug #12908, bug #15669, bug #18363 involving ShowWindow; - bug #14785, bug #21060 involving EnterCriticalSection. But perhaps there's only a single issue.
Kirill K. Smirnov's ShowWindow patch in bug #15669, comment #3 fixes my test case in the present issue. It seems anterior to the same patch by Peter Dons Tychsen in bug #18363, comment #3. http://www.winehq.org/pipermail/wine-patches/2009-March/070748.html Why was it not committed? I found no comment in the wine-devel archives.
It seems like ShowWindow() is a kind of synchronous call which waits via WaitForMultipleObjectsEx() to return from send_inter_thread_message(). When ShowWindow is invoked after SetEvent(ack_event) the main thread is allowed to resume. Perhaps this causes some event loop to be entered somewhere, such that ShowWindow returns?
What is ShowWindow waiting for?
The main thread (which sent the MCI command) is blocked waiting for the ack_event (see attached log).
I don't understand why "play a wait" works. What's different (except nothing waits for ack_event)?