return true;
}
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
if ((ts & Thread::TS_Hijacked) != 0)
{
return true;
VPTR_CLASS(HelperMethodFrame_1OBJ)
VPTR_CLASS(HelperMethodFrame_2OBJ)
VPTR_CLASS(HelperMethodFrame_PROTECTOBJ)
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
VPTR_CLASS(HijackFrame)
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif
VPTR_CLASS(InlinedCallFrame)
#if defined(FEATURE_INCLUDE_ALL_INTERFACES) && defined(_TARGET_X86_)
VPTR_CLASS(LeaveRuntimeFrame)
VPTR_CLASS(PrestubMethodFrame)
VPTR_CLASS(ProtectByRefsFrame)
VPTR_CLASS(ProtectValueClassFrame)
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
VPTR_CLASS(ResumableFrame)
VPTR_CLASS(RedirectedThreadFrame)
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif
VPTR_CLASS(StubDispatchFrame)
VPTR_CLASS(ExternalMethodFrame)
#ifdef FEATURE_READYTORUN
pRD->IsCallerSPValid = FALSE; // Don't add usage of this field. This is only temporary.
}
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
TADDR ResumableFrame::GetReturnAddressPtr()
{
LIMITED_METHOD_DAC_CONTRACT;
pRD->SP = (ULONG64)(pRD->PCTAddr + sizeof(TADDR));
*/
}
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
BOOL isJumpRel32(PCODE pCode)
{
NESTED_END JIT_RareDisableHelper, _TEXT
-#ifdef FEATURE_UNIX_GC_REDIRECT_HIJACK
+#ifdef FEATURE_HIJACK
//------------------------------------------------
// OnHijackScalarTripThread
NESTED_END OnHijackInteriorPointerTripThread, _TEXT
-#endif // FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
LEAF_ENTRY SinglecastDelegateInvokeStub, _TEXT
IMPORT OnHijackObjectWorker
IMPORT OnHijackInteriorPointerWorker
IMPORT OnHijackScalarWorker
-#endif ; FEATURE_HIJACK
+#endif ;FEATURE_HIJACK
IMPORT GetCurrentSavedRedirectContext
}
#ifdef FEATURE_HIJACK
-
TADDR ResumableFrame::GetReturnAddressPtr(void)
{
LIMITED_METHOD_DAC_CONTRACT;
SyncRegDisplayToCurrentContext(pRD);
}
-
-#endif // FEATURE_HIJACK
+#endif
void PInvokeStubForHost(void)
{
// the operating system will not be able to walk the stack and not find the handlers for
// the exception. It is safe to unhijack the thread in this case for two reasons:
// 1. pThread refers to *this* thread.
- // 2. If another thread trys to hijack this thread, it will see we are not in managed
+ // 2. If another thread tries to hijack this thread, it will see we are not in managed
// code (and thus won't try to hijack us).
#if defined(WIN64EXCEPTIONS)
if (pThread != NULL)
return retVal;
#else // !FEATURE_PAL
-#ifdef FEATURE_UNIX_GC_REDIRECT_HIJACK
+#if defined(WIN64EXCEPTIONS) && defined(FEATURE_HIJACK)
Thread *pThread = GetThread();
if (pThread != NULL)
{
}
}
-#if defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#if defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
// This function is used to check if the specified IP is in the prolog or not.
bool IsIPInProlog(EECodeInfo *pCodeInfo)
return fIsInEpilog;
}
-#endif // defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#endif // defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
#define EXCEPTION_VISUALCPP_DEBUGGER ((DWORD) (1<<30 | 0x6D<<16 | 5000))
BOOL IsExceptionFromManagedCode(const EXCEPTION_RECORD * pExceptionRecord);
bool IsIPInMarkedJitHelper(UINT_PTR uControlPc);
-#if defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#if defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
// General purpose functions for use on an IP in jitted code.
bool IsIPInProlog(EECodeInfo *pCodeInfo);
bool IsIPInEpilog(PTR_CONTEXT pContextToCheck, EECodeInfo *pCodeInfo, BOOL *pSafeToInjectThreadAbort);
-#endif // defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#endif // defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
void RaiseFailFastExceptionOnWin7(PEXCEPTION_RECORD pExceptionRecord, PT_CONTEXT pContext);
ULONG64 stackHighAddress = (ULONG64)PAL_GetStackBase();
ULONG64 stackLowAddress = (ULONG64)PAL_GetStackLimit();
-GetThread()->UnhijackThread(); //////////////
-
-
+ GetThread()->UnhijackThread();
RtlCaptureContext(&frameContext);
// +- FaultingExceptionFrame - this frame was placed on a method which faulted
// | to save additional state information
// |
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
// |
// +-HijackFrame - if a method's return address is hijacked, we
// | construct one of these to allow crawling back
// | |
// | +-RedirectedThreadFrame - this frame is used for redirecting threads during suspension
// |
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
// |
// |
#ifdef FEATURE_REMOTING
FRAME_ABSTRACT_TYPE_NAME(FrameBase)
FRAME_ABSTRACT_TYPE_NAME(Frame)
FRAME_ABSTRACT_TYPE_NAME(TransitionFrame)
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
FRAME_TYPE_NAME(ResumableFrame)
FRAME_TYPE_NAME(RedirectedThreadFrame)
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
FRAME_TYPE_NAME(FaultingExceptionFrame)
#ifdef DEBUGGING_SUPPORTED
FRAME_TYPE_NAME(FuncEvalFrame)
FRAME_TYPE_NAME(ComPrestubMethodFrame)
#endif // FEATURE_COMINTEROP
FRAME_TYPE_NAME(PInvokeCalliFrame)
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
FRAME_TYPE_NAME(HijackFrame)
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
FRAME_TYPE_NAME(PrestubMethodFrame)
FRAME_TYPE_NAME(StubDispatchFrame)
FRAME_TYPE_NAME(ExternalMethodFrame)
VPTR_ABSTRACT_VTABLE_CLASS(Frame, FrameBase)
public:
+
#if defined(FEATURE_PAL) && !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
virtual ~Frame();
#endif // FEATURE_PAL && !DACCESS_COMPILE && !CROSSGEN_COMPILE
// exception. The FRAME_ATTR_RESUMABLE flag tells
// the GC that the preceding frame needs to be treated
// like the top of stack (with the important implication that
-// caller-save-registers will be potential roots).
+// caller-save-regsiters will be potential roots).
//-----------------------------------------------------------------------------
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
//-----------------------------------------------------------------------------
class ResumableFrame : public Frame
public:
#ifndef DACCESS_COMPILE
- RedirectedThreadFrame(T_CONTEXT *regs) : ResumableFrame(regs)
- {
+ RedirectedThreadFrame(T_CONTEXT *regs) : ResumableFrame(regs) {
LIMITED_METHOD_CONTRACT;
}
}
//------------------------------------------------------------------------
-#else // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#else // FEATURE_HIJACK
//------------------------------------------------------------------------
inline BOOL ISREDIRECTEDTHREAD(Thread * thread) { LIMITED_METHOD_CONTRACT; return FALSE; }
inline CONTEXT * GETREDIRECTEDCONTEXT(Thread * thread) { LIMITED_METHOD_CONTRACT; return (CONTEXT*) NULL; }
//------------------------------------------------------------------------
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
//------------------------------------------------------------------------
// This frame represents a transition from one or more nested frameless
// method calls to either a EE runtime helper function or a framed method.
};
// Some context-related forwards.
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
//------------------------------------------------------------------------
// This frame represents a hijacked return. If we crawl back through it,
// it gets us back to where the return should have gone (and eventually will
DEFINE_VTABLE_GETTER_AND_CTOR(HijackFrame)
};
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
//------------------------------------------------------------------------
// This represents a call to a method prestub. Because the prestub
pRD->Esp = (DWORD)(pRD->PCTAddr + sizeof(TADDR));
}
-#endif // FEATURE_HIJACK
+#endif // FEATURE_HIJACK
void PInvokeCalliFrame::UpdateRegDisplay(const PREGDISPLAY pRD)
{
}
}
-#ifdef FEATURE_HIJACK
+#ifdef FEATURE_HIJACK
void
CPFH_AdjustContextForThreadSuspensionRace(CONTEXT *pContext, Thread *pThread)
{
STRESS_LOG1(LF_EH, LL_INFO100, "CPFH_AdjustContextForThreadSuspensionRace: Case 4 setting IP = %x\n", pContext->Eip);
}
}
-
#endif // FEATURE_HIJACK
Thread *pThread = GetThread();
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
// We can't crawl the stack of a thread that currently has a hijack pending
// (since the hijack routine won't be recognized by any code manager). So we
// undo any hijack, the EE will re-attempt it later.
BEGIN_FORBID_TYPELOAD();
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
// We can't crawl the stack of a thread that currently has a hijack pending
// (since the hijack routine won't be recognized by any code manager). So we
// undo any hijack, the EE will re-attempt it later.
pThread->UnhijackThread();
#endif // !DACCESS_COMPILE
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
// FRAME_TOP and NULL must be distinct values. This assert
// will fire if someone changes this.
// In normal case (no GCStress), after p/invoke, IL_STUB will check if GC is in progress and syncronize.
BOOL bRedirectedPinvoke = FALSE;
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
bRedirectedPinvoke = ((GCStress<cfg_instr>::IsEnabled()) &&
(m_pRealStartFrame != NULL) &&
(m_pRealStartFrame != FRAME_TOP) &&
(m_pThread->GetFrame() != NULL) &&
(m_pThread->GetFrame() != FRAME_TOP) &&
(m_pThread->GetFrame()->GetVTablePtr() == RedirectedThreadFrame::GetMethodFrameVPtr()));
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
_ASSERTE( (m_pStartFrame != NULL) ||
(m_flags & POPFRAMES) ||
m_pCurrentStackGuard = NULL;
#endif
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
m_ppvHJRetAddrPtr = (VOID**) 0xCCCCCCCCCCCCCCCC;
m_pvHJRetAddr = (VOID*) 0xCCCCCCCCCCCCCCCC;
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
-#ifdef FEATURE_HIJACK
X86_ONLY(m_LastRedirectIP = 0);
X86_ONLY(m_SpinCount = 0);
#endif // FEATURE_HIJACK
if (thread->CatchAtSafePoint())
{
_ASSERTE(!ThreadStore::HoldingThreadStore(thread));
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
thread->UnhijackThread();
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
// Trap
thread->PulseGCMode();
pInfo->timeStamp = getTimeStamp();
pInfo->threadID = GetCurrentThreadId();
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
// We can't crawl the stack of a thread that currently has a hijack pending
// (since the hijack routine won't be recognized by any code manager). So we
// undo any hijack, the EE will re-attempt it later.
#endif // TRACK_SYNC
-#if defined(FEATURE_HIJACK)
+//***************************************************************************
+#ifdef FEATURE_HIJACK
// Used to capture information about the state of execution of a *SUSPENDED* thread.
struct ExecutionState;
#ifndef PLATFORM_UNIX
-//***************************************************************************
// This is the type of the start function of a redirected thread pulled from
// a HandledJITCase during runtime suspension
typedef void (__stdcall *PFN_REDIRECTTARGET)();
#endif // FEATURE_HIJACK
//***************************************************************************
-
#ifdef ENABLE_CONTRACTS_IMPL
inline Thread* GetThreadNULLOk()
{
// When we want to take control of a thread at a safe point, the thread will
// eventually come back to us in one of the following trip functions:
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
+
EXTERN_C void __stdcall OnHijackObjectTripThread(); // hijacked JIT code is returning an objectref
EXTERN_C void __stdcall OnHijackInteriorPointerTripThread(); // hijacked JIT code is returning a byref
EXTERN_C void __stdcall OnHijackScalarTripThread(); // hijacked JIT code is returning a non-objectref, non-FP
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
-#if defined(FEATURE_HIJACK) && defined(_TARGET_X86_)
+#ifdef _TARGET_X86_
EXTERN_C void __stdcall OnHijackFloatingPointTripThread(); // hijacked JIT code is returning an FP value
-#endif // FEATURE_HIJACK && _TARGET_X86_
+#endif // _TARGET_X86_
+
+#endif // FEATURE_HIJACK
void CommonTripThread();
// unstarted System.Thread), then this instance can be found in the TLS
// of that physical thread.
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
EXTERN_C void STDCALL OnHijackObjectWorker(HijackArgs * pArgs);
EXTERN_C void STDCALL OnHijackInteriorPointerWorker(HijackArgs * pArgs);
EXTERN_C void STDCALL OnHijackScalarWorker(HijackArgs * pArgs);
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
// This is the code we pass around for Thread.Interrupt, mainly for assertions
#define APC_Code 0xEECEECEE
friend void CommonTripThread();
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
// MapWin32FaultToCOMPlusException needs access to Thread::IsAddrOfRedirectFunc()
friend DWORD MapWin32FaultToCOMPlusException(EXCEPTION_RECORD *pExceptionRecord);
friend void STDCALL OnHijackObjectWorker(HijackArgs *pArgs);
friend void STDCALL OnHijackInteriorPointerWorker(HijackArgs *pArgs);
friend void STDCALL OnHijackScalarWorker(HijackArgs *pArgs);
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
-#ifdef FEATURE_UNIX_GC_REDIRECT_HIJACK
+#ifdef PLATFORM_UNIX
friend void PALAPI HandleGCSuspensionForInterruptedThread(CONTEXT *interruptedContext);
-#endif // FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // PLATFORM_UNIX
+
+#endif // FEATURE_HIJACK
friend void InitThreadManager();
friend void ThreadBaseObject::SetDelegate(OBJECTREF delegate);
TS_YieldRequested = 0x00000040, // The task should yield
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
TS_Hijacked = 0x00000080, // Return address has been hijacked
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
TS_BlockGCForSO = 0x00000100, // If a thread does not have enough stack, WaitUntilGCComplete may fail.
// Either GC suspension will wait until the thread has cleared this bit,
STR_SwitchedOut,
};
-#ifdef FEATURE_UNIX_GC_REDIRECT_HIJACK
+#if defined(FEATURE_HIJACK) && defined(PLATFORM_UNIX)
bool InjectGcSuspension();
-#endif // FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK && PLATFORM_UNIX
#ifndef DISABLE_THREADSUSPEND
// SuspendThread
BOOL IsRudeUnload();
BOOL IsFuncEvalAbort();
-#if defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#if defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
BOOL IsSafeToInjectThreadAbort(PTR_CONTEXT pContextToCheck);
-#endif // defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#endif // defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
inline BOOL IsAbortRequested()
{
public:
FORCEINLINE void UnhijackThreadNoAlloc()
{
-#if (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)) && !defined(DACCESS_COMPILE)
+#if defined(FEATURE_HIJACK) && !defined(DACCESS_COMPILE)
if (m_State & TS_Hijacked)
{
*m_ppvHJRetAddrPtr = m_pvHJRetAddr;
BOOL GetSafelyRedirectableThreadContext(DWORD dwOptions, T_CONTEXT * pCtx, REGDISPLAY * pRD);
private:
-#if defined(FEATURE_HIJACK)
+#ifdef FEATURE_HIJACK
void HijackThread(VOID *pvHijackAddr, ExecutionState *esb);
VOID *m_pvHJRetAddr; // original return address (before hijack)
VOID **m_ppvHJRetAddrPtr; // place we bashed a new return address
MethodDesc *m_HijackedFunction; // remember what we hijacked
-#if !defined(PLATFORM_UNIX)
+#ifndef PLATFORM_UNIX
BOOL HandledJITCase(BOOL ForTaskSwitchIn = FALSE);
#ifdef _TARGET_X86_
{
WRAPPER_NO_CONTRACT;
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
- // Only unhijack the thread if the suspend succeeded. If it failed,
+#ifdef FEATURE_HIJACK
+ // Only unhijack the thread if the suspend succeeded. If it failed,
// the target thread may currently be using the original stack
// location of the return address for something else.
if (SuspendSucceeded)
UnhijackThread();
-#endif // defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#endif // FEATURE_HIJACK
ResetThreadState(TS_GCSuspendPending);
}
{
WRAPPER_NO_CONTRACT;
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
UnhijackThread();
-#endif // defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#endif // FEATURE_HIJACK
ResetThrowControlForThread();
// Since this Thread has taken an SO, there may be state left-over after we
- // short-circuited exception or other error handling, and so we don't want
- // to risk recycling it.
+ // short-circuited exception or other error handling, and so we don't want
+ // to risk recycling it.
SetThreadStateNC(TSNC_CannotRecycle);
}
return sContext.m_fWithinCer;
}
-#if defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#if defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
BOOL Thread::IsSafeToInjectThreadAbort(PTR_CONTEXT pContextToCheck)
{
CONTRACTL
return TRUE;
}
}
-#endif // defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#endif // defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
#ifdef _TARGET_AMD64_
// CONTEXT_CONTROL does not include any nonvolatile registers that might be the frame pointer.
pStartFrame = pFrameAddr;
}
}
-#if defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#if defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
else if (ThrewControlForThread() == Thread::InducedThreadRedirect)
{
if (!IsSafeToInjectThreadAbort(m_OSContext))
return FALSE;
}
}
-#endif // defined(_TARGET_AMD64_) && (defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK))
+#endif // defined(_TARGET_AMD64_) && defined(FEATURE_HIJACK)
}
else
{
STRESS_LOG1(LF_SYNC, LL_INFO100000, "RareEnablePreemptiveGC: entering. Thread state = %x\n", m_State.Load());
if (!ThreadStore::HoldingThreadStore(this))
{
-#if defined(FEATURE_HIJACK) || defined(FEATURE_UNIX_GC_REDIRECT_HIJACK)
+#ifdef FEATURE_HIJACK
// Remove any hijacks we might have.
UnhijackThread();
-#endif // FEATURE_HIJACK || FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK
// wake up any threads waiting to suspend us, like the GC thread.
SetSafeEvent();
FastInterlockOr((ULONG *) &thread->m_State, Thread::TS_GCSuspendPending);
countThreads++;
-#ifdef FEATURE_UNIX_GC_REDIRECT_HIJACK
+#if defined(FEATURE_HIJACK) && defined(PLATFORM_UNIX)
bool gcSuspensionSignalSuccess = thread->InjectGcSuspension();
if (!gcSuspensionSignalSuccess)
{
STRESS_LOG1(LF_SYNC, LL_INFO1000, "Thread::SuspendRuntime() - Failed to raise GC suspension signal for thread %p.\n", thread);
}
-#endif // FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK && PLATFORM_UNIX
}
#else // DISABLE_THREADSUSPEND
}
#endif
-#ifdef FEATURE_UNIX_GC_REDIRECT_HIJACK
+#if defined(FEATURE_HIJACK) && defined(PLATFORM_UNIX)
_ASSERTE (thread == NULL);
while ((thread = ThreadStore::GetThreadList(thread)) != NULL)
{
#endif //TIME_SUSPEND
}
-#ifdef FEATURE_UNIX_GC_REDIRECT_HIJACK
+#if defined(FEATURE_HIJACK) && defined(PLATFORM_UNIX)
// This function is called when a GC is pending. It tries to ensure that the current
// thread is taken to a GC-safe place as quickly as possible. It does this by doing
return false;
}
-#endif // FEATURE_UNIX_GC_REDIRECT_HIJACK
+#endif // FEATURE_HIJACK && PLATFORM_UNIX
#ifdef _DEBUG
BOOL Debug_IsLockedViaThreadSuspension()