Make sure the thread running EventPipe::Disable is registered with the thread store...
authorAndrew Au <andrewau@microsoft.com>
Thu, 2 May 2019 20:32:48 +0000 (13:32 -0700)
committerAndrew Au <cshung@gmail.com>
Thu, 2 May 2019 23:11:03 +0000 (16:11 -0700)
src/vm/eventpipe.cpp

index fab4116..d3720bb 100644 (file)
@@ -341,6 +341,8 @@ void EventPipe::Disable(EventPipeSessionID id)
     }
     CONTRACTL_END;
 
+    SetupThread();
+
     // Only perform the disable operation if the session ID
     // matches the current active session.
     if (id != (EventPipeSessionID)s_pSession)
@@ -752,11 +754,7 @@ void EventPipe::WriteEventInternal(EventPipeEvent &event, EventPipeEventPayload
     }
     else if (s_pConfig->RundownEnabled())
     {
-        if (pThread == nullptr)
-        {
-            return;
-        }
-        
+        _ASSERTE(pThread != nullptr);
         BYTE *pData = payload.GetFlatData();
         if (pData != NULL)
         {