Add mono_gc_thread_detach callback. (mono/mono#18408)
authorJonathan Chambers <joncham@gmail.com>
Tue, 14 Jan 2020 11:56:09 +0000 (06:56 -0500)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Tue, 14 Jan 2020 11:56:09 +0000 (12:56 +0100)
commit5f91a8fca537c42fe8d85ba44d24bf43eb8bee56
tree6030d2bb96543e18607ec7f8a594e99b4ed91346
parent11b903f72ef8a35dc51bc7ce9bbb3eca34d553ae
Add mono_gc_thread_detach callback. (mono/mono#18408)

Add mono_gc_thread_detach callback for Boehm

Use under Boehm to detach without threads lock as Boehm will take it's own lock internally.

Note in `on_gc_notification` we take threads lock after Boehm already has it's own lock. For consistency and to prevent deadlocks always take lock ordering of Boehm then threads lock.

Commit migrated from https://github.com/mono/mono/commit/480bef72172856bd0f1a57243ddb53e98684f7d1
src/mono/mono/metadata/boehm-gc.c
src/mono/mono/metadata/gc-internals.h
src/mono/mono/metadata/null-gc.c
src/mono/mono/metadata/sgen-mono.c
src/mono/mono/metadata/threads.c