Skip to content

Commit

Permalink
move InitializeRuntime call to within TSF_Attached state check (dotne…
Browse files Browse the repository at this point in the history
  • Loading branch information
tonerdo committed Nov 11, 2017
1 parent 6738e30 commit 6575a65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Native/Runtime/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,9 +1119,11 @@ extern "C" int InitializeRuntime();

void Thread::ReversePInvokeAttachOrTrapThread(ReversePInvokeFrame * pFrame)
{
InitializeRuntime();
if (!IsStateSet(TSF_Attached))
{
InitializeRuntime();
ThreadStore::AttachCurrentThread();
}

// If the thread is already in cooperative mode, this is a bad transition.
if (IsCurrentThreadInCooperativeMode())
Expand Down

0 comments on commit 6575a65

Please sign in to comment.