Skip to content

Commit b06cfe5

Browse files
author
Lifeng Lu
committed
remove NotifyOfCrossThreadDependency call
when a debugger is attached, NotifyOfCrossThreadDependency will freeze the thread to send notification to the debugger. Because this NoMessagePumpSynchronizationContext is heavily used, including nested inside code holding the JTF lock, this leads the process being debugged becomes extremely slow when JTF is heavily used.
1 parent 8496766 commit b06cfe5

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/Microsoft.VisualStudio.Threading/JoinableTaskContext.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,6 @@ protected internal virtual SynchronizationContext NoMessagePumpSynchronizationCo
302302
{
303303
get
304304
{
305-
// Callers of this method are about to take a private lock, which tends
306-
// to cause a deadlock while debugging because of lock contention with the
307-
// debugger's expression evaluator. So prevent that.
308-
Debugger.NotifyOfCrossThreadDependency();
309-
310305
return NoMessagePumpSyncContext.Default;
311306
}
312307
}

0 commit comments

Comments
 (0)