diff --git a/src/coreclr/nativeaot/Runtime/thread.cpp b/src/coreclr/nativeaot/Runtime/thread.cpp index d0a1d1297d74ab..fb9d64885e6d52 100644 --- a/src/coreclr/nativeaot/Runtime/thread.cpp +++ b/src/coreclr/nativeaot/Runtime/thread.cpp @@ -68,6 +68,12 @@ PInvokeTransitionFrame* Thread::GetTransitionFrameForStackTrace() return m_pDeferredTransitionFrame; } +PInvokeTransitionFrame* Thread::GetTransitionFrameForSampling() +{ + CrossThreadUnhijack(); + return GetTransitionFrame(); +} + void Thread::WaitForGC(PInvokeTransitionFrame* pTransitionFrame) { ASSERT(!IsDoNotTriggerGcSet()); diff --git a/src/coreclr/nativeaot/Runtime/thread.h b/src/coreclr/nativeaot/Runtime/thread.h index 3a251ee9afa932..83249cfc6bc77e 100644 --- a/src/coreclr/nativeaot/Runtime/thread.h +++ b/src/coreclr/nativeaot/Runtime/thread.h @@ -320,7 +320,7 @@ class Thread : private RuntimeThreadLocals bool IsCurrentThreadInCooperativeMode(); PInvokeTransitionFrame* GetTransitionFrameForStackTrace(); - PInvokeTransitionFrame* GetTransitionFrameForSampling() { return GetTransitionFrame(); } + PInvokeTransitionFrame* GetTransitionFrameForSampling(); void * GetCurrentThreadPInvokeReturnAddress(); //