[suspend] Remove sgen specific suspend code (#3640)
authorLudovic Henry <ludovic@xamarin.com>
Wed, 26 Oct 2016 18:57:17 +0000 (14:57 -0400)
committerGitHub <noreply@github.com>
Wed, 26 Oct 2016 18:57:17 +0000 (14:57 -0400)
commita0d20ebbf712fe2b196352c1210a7b44676543e7
tree2cd5aa6fc6e436dfe2658e910c270e3f4c82a3d4
parent0976d12d6730ce6228c9a6533fd9119ba0c46560
[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:
mono/metadata/Makefile.am
mono/metadata/boehm-gc.c
mono/metadata/domain.c
mono/metadata/gc-internals.h
mono/metadata/null-gc.c
mono/metadata/sgen-client-mono.h
mono/metadata/sgen-mono.c
mono/metadata/sgen-os-coop.c [deleted file]
mono/metadata/sgen-os-mach.c [deleted file]
mono/metadata/sgen-os-posix.c [deleted file]
mono/metadata/sgen-os-win32.c [deleted file]
mono/metadata/sgen-stw.c
mono/mini/mini-posix.c
mono/utils/Makefile.am
mono/utils/mono-threads-coop.c
mono/utils/mono-threads-debug.h [new file with mode: 0644]
mono/utils/mono-threads-mach-abort-syscall.c [deleted file]
mono/utils/mono-threads-mach.c
mono/utils/mono-threads-posix-abort-syscall.c [deleted file]
mono/utils/mono-threads-posix-signals.c
mono/utils/mono-threads-posix-signals.h [deleted file]
mono/utils/mono-threads-posix.c
mono/utils/mono-threads-state-machine.c
mono/utils/mono-threads-windows-abort-syscall.c [deleted file]
mono/utils/mono-threads-windows.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
msvc/libmonoruntime.vcxproj
msvc/libmonoruntime.vcxproj.filters
msvc/libmonoutils.vcxproj