Hybrid suspend and checked build fixes (async signal safety) (#8269)
commit1a525f1193310024898cec750371268754d3b389
authorAleksey Kliger (λgeek) <akliger@gmail.com>
Tue, 17 Apr 2018 11:26:08 +0000 (17 07:26 -0400)
committerLudovic Henry <luhenry@microsoft.com>
Tue, 17 Apr 2018 11:26:08 +0000 (17 07:26 -0400)
treee58b3ee8136ffeeb31ea44272d2d944370fb31a5
parentf41f8f202037dc51b2aaed1096bb9e07f70f6acf
Hybrid suspend and checked build fixes (async signal safety) (#8269)

* [threads] Have Hybrid Suspend not depend on Coop Suspend

* [threads] Enable CI

* [hybrid suspend] Wait for pending operations when suspending a blocking thread

In hybrid suspend we should wait for the pending suspend to finish when we're
suspending a blocking thread.

In full cooperative suspend, we treat blocking threads as already suspended, so
in that case there is nothing to wait for.

* [checked-build] don't use malloc for thread state history

Use a ring buffer, so we're signal safe.

* [checked-build] checked_build_thread_transition - async signal safe variant

Can't call backtrace on Linux from a signal handler.

Change mono_threads_transition_finish_async_suspend not to collect a
backtrace.
mono/utils/checked-build.c
mono/utils/checked-build.h
mono/utils/mono-threads-state-machine.c
mono/utils/mono-threads.c