Replicate .NET behavior for exceptions in the finalizer thread.
authoralexrp <xtzgzorex@gmail.com>
Wed, 25 Apr 2012 13:57:40 +0000 (15:57 +0200)
committeralexrp <xtzgzorex@gmail.com>
Wed, 25 Apr 2012 17:05:34 +0000 (19:05 +0200)
commit59883a039925be9ff3e478d265aa7be896fbda79
tree1fbc6a5722c6b8d717fec2c252dd8bf301f382c6
parentbfea12c4829e377e4186304dff1c72d327d85383
Replicate .NET behavior for exceptions in the finalizer thread.

On .NET, when an exception occurs in the finalizer thread, it is
printed, the AppDomain.UnhandledException event is raised, and
the runtime is aborted (exact same thing as what happens when an
exception is thrown in a thread pool thread).

We now do the same.

Note that this is a breaking change; previously, we just silently
swallowed exceptions that occurred in the finalizer thread. Given
this, a test had to be adjusted (and renamed). An extra test has
been added to verify that the UnhandledException event is raised
correctly.
mono/metadata/gc.c
mono/metadata/threadpool-internals.h
mono/metadata/threadpool.c
mono/tests/Makefile.am
mono/tests/finalizer-exception.cs
mono/tests/finalizer-thread.cs [new file with mode: 0644]