[suspend] Remove sgen specific suspend code (#3640)
* [suspend] Remove sgen specific suspend code
* [sgen] Remove unused SgenClientThreadInfo->stopped_domain field
* [sgen] Remove unused SgenClientThreadInfo->stopped_ip field
* [threads] Unsplit code for syscall abort
* [threads] Reuse posix suspend signal handler function for abort
* [mono-threads] Move debug printf to separate file
This is to avoid recompiling half of the runtime for every change to these printf.
* [stw] Slightly improve logging
* [mono-threads] Fix unified thread suspend
`mono_threads_suspend_begin_async_suspend` return FALSE iff it coudn't successfully suspend the thread, not if the thread is not in the correct state. The latter is checked by calling `mono_threads_suspend_check_suspend_result` which will return FALSE if we couldn't initialize the state of the suspended thread.
* [mono-threads] Fix unified thread suspend
If we try to suspend a thread that is still attaching, we might suspend it after it allocated the MonoInternalThread and MonoThread, but before it set the current domain or lmf. This would lead us to not scan the thread stack, which would lead to collect the newly allocate MonoInternalThread/MonoThread, leading to a crash. By letting sgen deal with the thread, even if the domain or the lmf is not set, we avoid this bug.
This makes unified suspend have the same behaviour as the previous sgen specific suspend.
* [mono-threads] Fix compilation
30 files changed: