Skip to content

Commit 0a1fb70

Browse files
authored
NativeAOT: Unhijack thread in sampling profiler before starting stack walk (#116409)
1 parent 0f2bfae commit 0a1fb70

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/coreclr/nativeaot/Runtime/thread.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ PInvokeTransitionFrame* Thread::GetTransitionFrameForStackTrace()
6868
return m_pDeferredTransitionFrame;
6969
}
7070

71+
PInvokeTransitionFrame* Thread::GetTransitionFrameForSampling()
72+
{
73+
CrossThreadUnhijack();
74+
return GetTransitionFrame();
75+
}
76+
7177
void Thread::WaitForGC(PInvokeTransitionFrame* pTransitionFrame)
7278
{
7379
ASSERT(!IsDoNotTriggerGcSet());

src/coreclr/nativeaot/Runtime/thread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class Thread : private RuntimeThreadLocals
320320
bool IsCurrentThreadInCooperativeMode();
321321

322322
PInvokeTransitionFrame* GetTransitionFrameForStackTrace();
323-
PInvokeTransitionFrame* GetTransitionFrameForSampling() { return GetTransitionFrame(); }
323+
PInvokeTransitionFrame* GetTransitionFrameForSampling();
324324
void * GetCurrentThreadPInvokeReturnAddress();
325325

326326
//

0 commit comments

Comments
 (0)