Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure mono_gc_thread_detach is always called. (#47816)
The previous logic would not call `mono_gc_thread_detach` for a number of scenarios. One example: ``` start_wrapper - mono_thread_info_attach - thread is now live in mono threads layer - start_wrapper_internal -- mono_thread_attach_internal - mono attached to vm thread layer. GC handle is set via mono_thread_info_set_internal_thread_gchandle -- mono_thread_detach_internal - detached from vm thread layer. GC handle cleared via call to mono_thread_info_unset_internal_thread_gchandle - mono_thread_info_exit -- mono_thread_info_detach --- unregister_thread ---- thread_detach callback - checks if gc handle is valid and returns if not via mono_thread_info_try_get_internal_thread_gchandle. We've already cleared above so we never call mono_gc_thread_detach. ``` This change ensures `mono_gc_thread_detach` is always called even the GC handle for the thread has already been cleared.
- Loading branch information