Make WaitHandle.Wait* behave the same wrt WAIT_IO_COMPLETION. Fixes #8566.
commit2209daad1c2fcfdfdd7117c710e01c58e0027d32
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Fri, 23 Nov 2012 12:07:42 +0000 (23 13:07 +0100)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 28 Nov 2012 00:23:20 +0000 (28 01:23 +0100)
treed107b51befe6e0f725cb9f5464bd756862537aaf
parent21fad6dbbdcbd89166783b580c80b3d13bfa30b4
Make WaitHandle.Wait* behave the same wrt WAIT_IO_COMPLETION. Fixes #8566.

Make the all check for exceptions if interrupted, and wait again
with a re-calculated timeout if no exceptions were to be thrown.

This fixes a deadlock in WaitAny, because WaitAny wasn't checking
for exceptions, just re-calculating the timeout. It also makes
the methods behave the same wrt other APC reasons.
mcs/class/corlib/Test/System.Threading/WaitHandleTest.cs
mono/metadata/threads.c