summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vm/eventpipe.cpp2
-rw-r--r--src/vm/eventpipebuffermanager.cpp2
-rw-r--r--src/vm/eventpipesession.cpp4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp
index 0458be8854..c049244620 100644
--- a/src/vm/eventpipe.cpp
+++ b/src/vm/eventpipe.cpp
@@ -460,7 +460,7 @@ void EventPipe::DisableInternal(EventPipeSessionID id, EventPipeProviderCallback
EventPipeSession *EventPipe::GetSession(EventPipeSessionID id)
{
LIMITED_METHOD_CONTRACT;
- _ASSERTE(IsLockOwnedByCurrentThread());
+ CrstHolder _crst(GetLock());
if (s_pSessions == nullptr)
return nullptr;
diff --git a/src/vm/eventpipebuffermanager.cpp b/src/vm/eventpipebuffermanager.cpp
index b7351613d5..c3540fc14d 100644
--- a/src/vm/eventpipebuffermanager.cpp
+++ b/src/vm/eventpipebuffermanager.cpp
@@ -616,7 +616,7 @@ EventPipeEventInstance* EventPipeBufferManager::GetNextEvent()
{
CONTRACTL
{
- NOTHROW;
+ THROWS;
GC_NOTRIGGER;
MODE_ANY;
PRECONDITION(!EventPipe::IsLockOwnedByCurrentThread());
diff --git a/src/vm/eventpipesession.cpp b/src/vm/eventpipesession.cpp
index af1a5af212..5d729f6839 100644
--- a/src/vm/eventpipesession.cpp
+++ b/src/vm/eventpipesession.cpp
@@ -182,7 +182,9 @@ DWORD WINAPI EventPipeSession::ThreadProc(void *args)
pEventPipeSession->SetThreadShutdownEvent();
if (!fSuccess)
- pEventPipeSession->Disable();
+ {
+ EventPipe::RunWithCallbackPostponed([pEventPipeSession](EventPipeProviderCallbackDataQueue *pEventPipeProviderCallbackDataQueue){pEventPipeSession->Disable();});
+ }
}
EX_CATCH
{