Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/coreclr/interop/trackerobjectmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ namespace

STDMETHODIMP HostServices::ReleaseDisconnectedReferenceSources()
{
return InteropLibImports::WaitForRuntimeFinalizerForExternal();
// We'd like to call InteropLibImports::WaitForRuntimeFinalizerForExternal() here, but this could
// lead to deadlock if the finalizer thread is trying to get back to this thread, because we are
// not pumping anymore. Disable this for now. See: https://github.com/dotnet/runtime/issues/109538.
return S_OK;
}

STDMETHODIMP HostServices::NotifyEndOfReferenceTrackingOnThread()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1418,15 +1418,10 @@ internal static unsafe int IReferenceTrackerHost_DisconnectUnusedReferenceSource
[UnmanagedCallersOnly]
internal static unsafe int IReferenceTrackerHost_ReleaseDisconnectedReferenceSources(IntPtr pThis)
{
try
{
GC.WaitForPendingFinalizers();
return HResults.S_OK;
}
catch (Exception e)
{
return Marshal.GetHRForException(e);
}
// We'd like to call GC.WaitForPendingFinalizers() here, but this could lead to deadlock
// if the finalizer thread is trying to get back to this thread, because we are not pumping
// anymore. Disable this for now. See: https://github.com/dotnet/runtime/issues/109538.
return HResults.S_OK;
}

[UnmanagedCallersOnly]
Expand Down
Loading