Hi folks,
Due to my new found belief that all of the flaws in Wine
are timing problems, I have found what appears to be a
gaping hole in Wine's timing behavior.
Specifically, it appears as though any style of
Waitxxx is supposed to yield the processor.
This seems a bit difficult for me to believe,
even though we had earlier discovered that Wine was never
yielding on a Sleep(0).
I've attached the test program I used to discover
this. If you run
sleep2 -1 0w
the program will start 2 threads, one which spin loops
(-1), and one which does a wait on an object for 0
seconds. You'll see in the results that the Wait(...,0)
thread gets far fewer loops, and thus must be yielding.
Further, changing that to a 0ws (or even 5ws), which
means we're waiting on a signalled object, doesn't
change the behavior.
This leads me to suggest the attached patch.
I would appreciate review from other folks, because this
seems like a drastic change to me, and it strikes
me as equally likely that I've done something stupid.
Cheers,
Jeremy