Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
PerformWaitOrTimerCallback initialization fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benaadams committed Jun 27, 2016
1 parent dd47ed0 commit 7621765
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mscorlib/src/System/Threading/ThreadPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,8 @@ internal _ThreadPoolWaitOrTimerCallback(WaitOrTimerCallback waitOrTimerCallback,
[System.Security.SecurityCritical] // auto-generated
static internal void PerformWaitOrTimerCallback(Object state, bool timedOut)
{
ThreadPool.EnsureVMInitialized();

_ThreadPoolWaitOrTimerCallback helper = (_ThreadPoolWaitOrTimerCallback)state;
Contract.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!");
// call directly if it is an unsafe call OR EC flow is suppressed
Expand Down Expand Up @@ -1928,7 +1930,7 @@ unsafe public static bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapp

[SecurityCritical]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void EnsureVMInitialized()
internal static void EnsureVMInitialized()
{
if (!ThreadPoolGlobals.vmTpInitialized)
{
Expand Down

0 comments on commit 7621765

Please sign in to comment.