[release/6.0] Notify Reference Tracker runtime of disconnect at the right time (...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 2 Sep 2021 18:02:07 +0000 (11:02 -0700)
committerGitHub <noreply@github.com>
Thu, 2 Sep 2021 18:02:07 +0000 (11:02 -0700)
commitd76457861be69ae8e8acfebae7f9530398a5a797
tree6ea3ce1d30615570346c8d14da2ac8b97426aba6
parent6be45d23de2957a9de77bd42d29f3bc5bdcaaa5c
[release/6.0] Notify Reference Tracker runtime of disconnect at the right time (#58533)

* Notify Reference Tracker runtime of disconnect at the right time

Based on misunderstanding of SyncBlock clean-up modes the indication of
when an Native Object Wrapper was being collected was being done after
the wrapper's Finalizer was run. However, this information must be conveyed
prior to wrapper finalization and synchronously during the GC.

* Review feedback.

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
src/coreclr/interop/comwrappers.cpp
src/coreclr/interop/comwrappers.hpp
src/coreclr/interop/inc/interoplib.h
src/coreclr/interop/interoplib.cpp
src/coreclr/interop/trackerobjectmanager.cpp
src/coreclr/vm/interoplibinterface_comwrappers.cpp
src/tests/Interop/COM/ComWrappers/API/Program.cs
src/tests/Interop/COM/ComWrappers/Common.cs
src/tests/Interop/COM/ComWrappers/MockReferenceTrackerRuntime/ReferenceTrackerRuntime.cpp