Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Remove always defined FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
Browse files Browse the repository at this point in the history
  • Loading branch information
danmoseley committed Feb 13, 2017
1 parent c65413f commit 5b9f6a1
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion clrdefinitions.cmake
Expand Up @@ -173,7 +173,6 @@ if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
endif ()
add_definitions(-DFEATURE_SVR_GC)
add_definitions(-DFEATURE_SYMDIFF)
add_definitions(-DFEATURE_SYNCHRONIZATIONCONTEXT_WAIT)
add_definitions(-DFEATURE_SYNTHETIC_CULTURES)
if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
add_definitions(-DFEATURE_MULTIREG_RETURN)
Expand Down
4 changes: 0 additions & 4 deletions src/vm/ecalllist.h
Expand Up @@ -1285,9 +1285,7 @@ FCFuncStart(gCompilerFuncs)
FCFuncEnd()

FCFuncStart(gContextSynchronizationFuncs)
#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
FCFuncElement("WaitHelperNative", SynchronizationContextNative::WaitHelper)
#endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
#ifdef FEATURE_APPX
QCFuncElement("GetWinRTDispatcherForCurrentThread", SynchronizationContextNative::GetWinRTDispatcherForCurrentThread)
#endif
Expand Down Expand Up @@ -1695,9 +1693,7 @@ FCClassElement("Stream", "System.IO", gStreamFuncs)
FCClassElement("String", "System", gStringFuncs)
FCClassElement("StringBuilder", "System.Text", gStringBufferFuncs)
FCClassElement("StubHelpers", "System.StubHelpers", gStubHelperFuncs)
#if defined(FEATURE_SYNCHRONIZATIONCONTEXT_WAIT) || defined(FEATURE_APPX)
FCClassElement("SynchronizationContext", "System.Threading", gContextSynchronizationFuncs)
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT || FEATURE_APPX
#if !defined(FEATURE_COREFX_GLOBALIZATION)
FCClassElement("TextInfo", "System.Globalization", gTextInfoFuncs)
#endif // !defined(FEATURE_COREFX_GLOBALIZATION)
Expand Down
2 changes: 0 additions & 2 deletions src/vm/mdaassistants.cpp
Expand Up @@ -139,7 +139,6 @@ void TriggerGCForMDAInternal()
{
GCHeapUtilities::GetGCHeap()->GarbageCollect();

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
//
// It is very dangerous to wait for finalizer thread here if we are inside a wait
// operation, as the wait operation might call into interop which calls this MDA
Expand All @@ -150,7 +149,6 @@ void TriggerGCForMDAInternal()
// So, if we are inside a SyncContext.Wait, don't call out to FinalizerThreadWait
//
if (!GetThread()->HasThreadStateNC(Thread::TSNC_InsideSyncContextWait))
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
// It is possible that user code run as part of finalization will wait for this thread.
// To avoid deadlocks, we limit the wait time to 10 seconds (an arbitrary number).
FinalizerThread::FinalizerThreadWait(10 * 1000);
Expand Down
2 changes: 0 additions & 2 deletions src/vm/metasig.h
Expand Up @@ -569,10 +569,8 @@ DEFINE_METASIG_T(SM(Obj_ArrStr_ArrObj_OutStreamingContext_RetSerializationInfo,
#endif // FEATURE_SERIALIZATION
DEFINE_METASIG(SM(Obj_OutStr_OutStr_OutArrStr_OutArrObj_RetObj, j r(s) r(s) r(a(s)) r(a(j)), j))

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
// Execution Context
DEFINE_METASIG_T(SM(SyncCtx_ArrIntPtr_Bool_Int_RetInt, C(SYNCHRONIZATION_CONTEXT) a(I) F i, i))
#endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

#ifdef FEATURE_COMINTEROP
// The signature of the method System.Runtime.InteropServices.ICustomQueryInterface.GetInterface
Expand Down
2 changes: 0 additions & 2 deletions src/vm/mscorlib.h
Expand Up @@ -1318,12 +1318,10 @@ DEFINE_CLASS(STRONG_NAME_KEY_PAIR, Reflection, StrongNameKeyPair)
DEFINE_METHOD(STRONG_NAME_KEY_PAIR, GET_KEY_PAIR, GetKeyPair, IM_RefObject_RetBool)
#endif

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
DEFINE_CLASS_U(Threading, SynchronizationContext, SynchronizationContextObject)
DEFINE_FIELD_U(_props, SynchronizationContextObject, _props)
DEFINE_CLASS(SYNCHRONIZATION_CONTEXT, Threading, SynchronizationContext)
DEFINE_METHOD(SYNCHRONIZATION_CONTEXT, INVOKE_WAIT_METHOD_HELPER, InvokeWaitMethodHelper, SM_SyncCtx_ArrIntPtr_Bool_Int_RetInt)
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

#ifdef FEATURE_COMINTEROP_TLB_SUPPORT
DEFINE_CLASS(TCE_EVENT_ITF_INFO, InteropTCE, EventItfInfo)
Expand Down
8 changes: 0 additions & 8 deletions src/vm/object.h
Expand Up @@ -1599,7 +1599,6 @@ typedef SecurityContextObject* SECURITYCONTEXTREF;
#endif
#endif // #if defined(FEATURE_IMPERSONATION) || defined(FEATURE_COMPRESSEDSTACK)

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
#define SYNCCTXPROPS_REQUIRESWAITNOTIFICATION 0x1 // Keep in sync with SynchronizationContext.cs SynchronizationContextFlags
class ThreadBaseObject;
class SynchronizationContextObject: public Object
Expand All @@ -1620,7 +1619,6 @@ class SynchronizationContextObject: public Object
return FALSE;
}
};
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

#ifdef FEATURE_REMOTING
class CallContextRemotingDataObject : public Object
Expand Down Expand Up @@ -1737,17 +1735,13 @@ typedef LogicalCallContextObject* LOGICALCALLCONTEXTREF;
typedef DPTR(class CultureInfoBaseObject) PTR_CultureInfoBaseObject;

#ifdef USE_CHECKED_OBJECTREFS
#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
typedef REF<SynchronizationContextObject> SYNCHRONIZATIONCONTEXTREF;
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
typedef REF<ExecutionContextObject> EXECUTIONCONTEXTREF;
typedef REF<CultureInfoBaseObject> CULTUREINFOBASEREF;
typedef REF<ArrayBase> ARRAYBASEREF;

#else
#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
typedef SynchronizationContextObject* SYNCHRONIZATIONCONTEXTREF;
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
typedef CultureInfoBaseObject* CULTUREINFOBASEREF;
typedef PTR_ArrayBase ARRAYBASEREF;
#endif
Expand Down Expand Up @@ -2109,13 +2103,11 @@ class ThreadBaseObject : public Object
}
#endif // FEATURE_LEAK_CULTURE_INFO

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
OBJECTREF GetSynchronizationContext()
{
LIMITED_METHOD_CONTRACT;
return m_SynchronizationContext;
}
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

#ifdef FEATURE_COMPRESSEDSTACK
COMPRESSEDSTACKREF GetCompressedStack()
Expand Down
2 changes: 0 additions & 2 deletions src/vm/synchronizationcontextnative.cpp
Expand Up @@ -20,7 +20,6 @@
#endif
#include "synchronizationcontextnative.h"

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
FCIMPL3(DWORD, SynchronizationContextNative::WaitHelper, PTRArray *handleArrayUNSAFE, CLR_BOOL waitAll, DWORD millis)
{
FCALL_CONTRACT;
Expand All @@ -46,7 +45,6 @@ FCIMPL3(DWORD, SynchronizationContextNative::WaitHelper, PTRArray *handleArrayUN
return ret;
}
FCIMPLEND
#endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

#ifdef FEATURE_APPX

Expand Down
2 changes: 0 additions & 2 deletions src/vm/synchronizationcontextnative.h
Expand Up @@ -19,9 +19,7 @@ class SynchronizationContextNative
{
public:

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
static FCDECL3(DWORD, WaitHelper, PTRArray *handleArrayUNSAFE, CLR_BOOL waitAll, DWORD millis);
#endif

#ifdef FEATURE_APPX
static void* QCALLTYPE GetWinRTDispatcherForCurrentThread();
Expand Down
4 changes: 0 additions & 4 deletions src/vm/threads.cpp
Expand Up @@ -4241,7 +4241,6 @@ DWORD Thread::DoAppropriateWaitWorker(int countHandles, HANDLE *handles, BOOL wa
DWORD ret = 0;

BOOL alertable = (mode & WaitMode_Alertable) != 0;
#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
// Waits from SynchronizationContext.WaitHelper are always just WaitMode_IgnoreSyncCtx.
// So if we defer to a sync ctx, we will lose any extra bits. We must therefore not
// defer to a sync ctx if doing any non-default wait.
Expand Down Expand Up @@ -4283,7 +4282,6 @@ DWORD Thread::DoAppropriateWaitWorker(int countHandles, HANDLE *handles, BOOL wa
if (fSyncCtxPresent)
return ret;
}
#endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

// Before going to pre-emptive mode the thread needs to be flagged as waiting for
// the debugger. This used to be accomplished by the TS_Interruptible flag but that
Expand Down Expand Up @@ -4707,7 +4705,6 @@ DWORD Thread::DoSignalAndWaitWorker(HANDLE* pHandles, DWORD millis,BOOL alertabl
}
#endif // !FEATURE_PAL

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
DWORD Thread::DoSyncContextWait(OBJECTREF *pSyncCtxObj, int countHandles, HANDLE *handles, BOOL waitAll, DWORD millis)
{
CONTRACTL
Expand Down Expand Up @@ -4737,7 +4734,6 @@ DWORD Thread::DoSyncContextWait(OBJECTREF *pSyncCtxObj, int countHandles, HANDLE

return invokeWaitMethodHelper.Call_RetI4(args);
}
#endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

// Called out of SyncBlock::Wait() to block this thread until the Notify occurs.
BOOL Thread::Block(INT32 timeOut, PendingSync *syncState)
Expand Down
6 changes: 0 additions & 6 deletions src/vm/threads.h
Expand Up @@ -1269,9 +1269,7 @@ class Thread: public IUnknown
// effort.
//
// Once we are completely independent of the OS UEF, we could remove this.
#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
TSNC_InsideSyncContextWait = 0x02000000, // Whether we are inside DoSyncContextWait
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
TSNC_DebuggerSleepWaitJoin = 0x04000000, // Indicates to the debugger that this thread is in a sleep wait or join state
// This almost mirrors the TS_Interruptible state however that flag can change
// during GC-preemptive mode whereas this one cannot.
Expand Down Expand Up @@ -2692,7 +2690,6 @@ class Thread: public IUnknown
return (ObjectFromHandle(m_ExposedObject) != NULL) ;
}

#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
void GetSynchronizationContext(OBJECTREF *pSyncContextObj)
{
CONTRACTL
Expand All @@ -2710,7 +2707,6 @@ class Thread: public IUnknown
if (ExposedThreadObj != NULL)
*pSyncContextObj = ExposedThreadObj->GetSynchronizationContext();
}
#endif // FEATURE_SYNCHRONIZATIONCONTEXT_WAIT

#ifdef FEATURE_COMPRESSEDSTACK
OBJECTREF GetCompressedStack()
Expand Down Expand Up @@ -3406,9 +3402,7 @@ class Thread: public IUnknown
DWORD DoSignalAndWaitWorker(HANDLE* pHandles, DWORD millis,BOOL alertable);
#endif // !FEATURE_PAL
DWORD DoAppropriateAptStateWait(int numWaiters, HANDLE* pHandles, BOOL bWaitAll, DWORD timeout, WaitMode mode);
#ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
DWORD DoSyncContextWait(OBJECTREF *pSyncCtxObj, int countHandles, HANDLE *handles, BOOL waitAll, DWORD millis);
#endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
public:

//************************************************************************
Expand Down

0 comments on commit 5b9f6a1

Please sign in to comment.