You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix reverse pinvoke with domain unloading (case 1304163)
Problem: Unattached thread makes reverse pinvoke call into managed code
in non-root domain. When domain is unloaded, if the thread has not
exited then the thread remains 'attached' and unloading hangs.
Solution: This is similar to what we do in mono_unity_thread_fast_attach
and mono_unity_thread_fast_detach. Always attach threads initially to
the root domain. Then set current thread domain to requested domain
and push a reference (mono_thread_push_appdomain_ref). When exiting
the reverese pinvoke, set the domain back to previous domain (root) and
pop the reference for that thread to the appdomain. This allows native
threads to outlive domains they ran code in.
0 commit comments