Bugzilla – Bug 8566
WaitHandle.WaitAny deadlocks if the thread is interrupted
Last modified: 2013-05-20 12:56:42 EDT
WaitHandle.WaitAny will deadlock if the thread is interrupted.
This happens to mdtool: it calls WaitAny and at process shutdown waits for the
thread to finish. The thread has been interrupted, so the WaitAny will never
return, thus the process will never exit either.
Created attachment 3002 [details]
Rodrigo, I believe this is somewhat your area, can you review the attached
It looks like this was detected some time ago:
The patch looks good except the remaining time calculation doesn't handle ticks
Nerver mind, we're using unsigned math already which handles this fine. So,
patch looks good, please commit.
Would it be better to use mono_100ns_ticks instead of mono_msec_ticks? If I did
the math right it won't overflow in 29k years.
It doesn't matter, both are monotonic, which is important. The current schema
would only be a problem if we get 2 wrap around in the same call, which is not
an issue at all.
From the implementation of mono_msec_ticks it looks like it will overflow every
49 days (the number of ms that fit in a uint32).
A slightly different version has been committed.
*** Bug 7003 has been marked as a duplicate of this bug. ***