@@ -4210,18 +4210,6 @@ bool Thread::SysSweepThreadsForDebug(bool forceSync)
42104210 if ((thread->m_State & TS_DebugWillSync) == 0 )
42114211 continue ;
42124212
4213- #ifdef FEATURE_SPECIAL_USER_MODE_APC
4214- if (thread->m_State & Thread::TS_SSToExitApcCallDone)
4215- {
4216- thread->ResetThreadState (Thread::TS_SSToExitApcCallDone);
4217- goto Label_MarkThreadAsSynced;
4218- }
4219- if (thread->m_State & Thread::TS_SSToExitApcCall)
4220- {
4221- continue ;
4222- }
4223- #endif
4224-
42254213 if (!UseContextBasedThreadRedirection ())
42264214 {
42274215 // On platforms that do not support safe thread suspension we either
@@ -5346,19 +5334,6 @@ BOOL Thread::HandledJITCase()
53465334#endif // FEATURE_HIJACK
53475335
53485336// Some simple helpers to keep track of the threads we are waiting for
5349- void Thread::MarkForSuspensionAndWait (ULONG bit)
5350- {
5351- CONTRACTL {
5352- NOTHROW;
5353- GC_NOTRIGGER;
5354- }
5355- CONTRACTL_END;
5356- m_DebugSuspendEvent.Reset ();
5357- InterlockedOr ((LONG*)&m_State, bit);
5358- ThreadStore::IncrementTrapReturningThreads ();
5359- m_DebugSuspendEvent.Wait (INFINITE,FALSE );
5360- }
5361-
53625337void Thread::MarkForSuspension (ULONG bit)
53635338{
53645339 CONTRACTL {
@@ -5781,8 +5756,7 @@ BOOL CheckActivationSafePoint(SIZE_T ip)
57815756// address to take the thread to the appropriate stub (based on the return
57825757// type of the method) which will then handle preparing the thread for GC.
57835758//
5784-
5785- void HandleSuspensionForInterruptedThread (CONTEXT *interruptedContext, bool suspendForDebugger)
5759+ void HandleSuspensionForInterruptedThread (CONTEXT *interruptedContext)
57865760{
57875761 struct AutoClearPendingThreadActivation
57885762 {
@@ -5818,18 +5792,6 @@ void HandleSuspensionForInterruptedThread(CONTEXT *interruptedContext, bool susp
58185792 if (!codeInfo.IsValid ())
58195793 return ;
58205794
5821- #ifdef FEATURE_SPECIAL_USER_MODE_APC
5822- // It's not allowed to change the IP while paused in an APC Callback for security reasons if CET is turned on
5823- // So we enable the single step in the thread that is running the APC Callback
5824- // and then it will be paused using single step exception after exiting the APC callback
5825- // this will allow the debugger to setIp to execute FuncEvalHijack.
5826- if (suspendForDebugger)
5827- {
5828- g_pDebugInterface->SingleStepToExitApcCall (pThread, interruptedContext);
5829- return ;
5830- }
5831- #endif
5832-
58335795 DWORD addrOffset = codeInfo.GetRelOffset ();
58345796
58355797 ICodeManager *pEECM = codeInfo.GetCodeManager ();
@@ -5905,11 +5867,6 @@ void HandleSuspensionForInterruptedThread(CONTEXT *interruptedContext, bool susp
59055867 }
59065868}
59075869
5908- void HandleSuspensionForInterruptedThread (CONTEXT *interruptedContext)
5909- {
5910- HandleSuspensionForInterruptedThread (interruptedContext, false );
5911- }
5912-
59135870#ifdef FEATURE_SPECIAL_USER_MODE_APC
59145871void Thread::ApcActivationCallback (ULONG_PTR Parameter)
59155872{
@@ -5936,10 +5893,10 @@ void Thread::ApcActivationCallback(ULONG_PTR Parameter)
59365893
59375894 switch (reason)
59385895 {
5939- case ActivationReason::SuspendForDebugger:
59405896 case ActivationReason::SuspendForGC:
5897+ case ActivationReason::SuspendForDebugger:
59415898 case ActivationReason::ThreadAbort:
5942- HandleSuspensionForInterruptedThread (pContext, reason == ActivationReason::SuspendForDebugger );
5899+ HandleSuspensionForInterruptedThread (pContext);
59435900 break ;
59445901
59455902 default :
0 commit comments