[runtime]Split thread unregistration in two steps, one with no locks, one with locks...
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 5 Nov 2013 14:54:59 +0000 (09:54 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 5 Nov 2013 14:59:27 +0000 (09:59 -0500)
commitcf8c83129debd5a5f34ec9c1a821a31c6de7866c
tree1d26bfe99620861f316ee75219db9c78ba3d06b0
parent1832b006bad3f3b2a5dc98550dd4af0586be72b3
[runtime]Split thread unregistration in two steps, one with no locks, one with locks taken. Fixes #15916.

In order allow for arbitrary code in the profiler callback we must invoke it without
holding any runtime leaf lock - this happens quite frequently with sdb as it tries to
suspend the world on those callbacks.

So thread shutdown is now split in two phases, first one that does the no-locks part
where the thread remains suspendable afterwards and then onewith locks taken where we
do the final cleanup and final shutdown.
mono/metadata/sgen-gc.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h