[corlib] Add API to uninstall/reinstall signal handlers.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Fri, 23 Sep 2016 11:53:36 +0000 (13:53 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Tue, 27 Sep 2016 10:35:14 +0000 (12:35 +0200)
commit59b6fde1b375e82de1a62ee772c1808cd379a53c
tree8759c5d2cce261b5bac2b570d49eabb46d3e6686
parent14bb051f363ff2770a4ccf183b616d7cef3ddb4c
[corlib] Add API to uninstall/reinstall signal handlers.

This API is provided to be used by libraries providing crash reporting, so
that those libraries can install signal handlers and at the same time not
interfere with Mono's signals.

The intended pattern is this:

    Mono.Runtime.RemoveSignalHandlers ();
    InstallThirdPartySignalHandlers ();
    Mono.Runtime.InstallSignalHandlers ();

This ensures that Mono is always notified first of any signals, and will then
chain to the third-party signal handlers if the signal did not originate in
managed code.

Mono's signals must first be removed, so that if third-party signal handler
does signal chaining, we don't end up in Mono's signal handler again.

Mailing-list thread: http://lists.dot.net/pipermail/macios-devel/2016-September/000016.html [Signal-chaining & crash reporters]
Example usage: https://github.com/rolfbjarne/HockeySDK-Xamarin/commit/862721199f1adec210bfc7b1943f975ffb8048a9
mcs/class/corlib/Mono/Runtime.cs
mono/mini/mini-posix.c
mono/mini/mini-runtime.c