[threads] Return suspend sort from begin_suspend_for_running_thread
commit7e728dcdbdaff99617632c3f8787459e0d430f3c
authorAleksey Kliger <alklig@microsoft.com>
Tue, 10 Apr 2018 21:14:52 +0000 (10 17:14 -0400)
committerAleksey Kliger <alklig@microsoft.com>
Tue, 10 Apr 2018 21:14:52 +0000 (10 17:14 -0400)
treea6222097607b58a12ff99340fd708c41577bd931
parentf214256be3ac375094aa22e1585a65cf2970874e
[threads] Return suspend sort from begin_suspend_for_running_thread

Change begin_cooperative_suspend and begin_preemptive_suspend to return one of
three results: suspend fail, suspend succeeded using cooperative suspend,
suspend succeeded using preemptive suspend.

This is used by check_async_suspend to decide whether to check the
MonoThreadInfo for the result of a suspend.  (If a thread is suspended
cooperatively, it doesn't make sense to check).

Fixes sporadic failures in mono/tests/monitor-abort.exe
mono/utils/mono-threads.c