Skip to content

Commit

Permalink
The thread triggering finalizer shutdown events should be in an alert…
Browse files Browse the repository at this point in the history
…able state. (dotnet#24133)
  • Loading branch information
AaronRobinsonMSFT authored and jkotas committed Apr 20, 2019
1 parent 0f93182 commit 324344f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vm/finalizerthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ class FinalizerThread

// Do not wait for FinalizerThread if the current one is FinalizerThread.
if (GetThread() != GetFinalizerThread())
hEventFinalizerToShutDown->Wait(INFINITE,FALSE);
{
// This wait must be alertable to handle cases where the current
// thread's context is needed (i.e. RCW cleanup)
hEventFinalizerToShutDown->Wait(INFINITE, /*alertable*/ TRUE);
}
}

static void FinalizerThreadWait(DWORD timeout = INFINITE);
Expand Down

0 comments on commit 324344f

Please sign in to comment.