diff options
-rw-r--r-- | src/mscorlib/src/System/Delegate.cs | 23 | ||||
-rw-r--r-- | src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs | 31 | ||||
-rw-r--r-- | src/mscorlib/src/System/Reflection/CustomAttribute.cs | 2 | ||||
-rw-r--r-- | src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs | 2 | ||||
-rw-r--r-- | src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs | 31 | ||||
-rw-r--r-- | src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs | 2 | ||||
-rw-r--r-- | src/mscorlib/src/System/Threading/Thread.cs | 22 | ||||
-rw-r--r-- | src/mscorlib/src/System/Threading/ThreadPool.cs | 41 | ||||
-rw-r--r-- | src/vm/comsynchronizable.cpp | 6 | ||||
-rw-r--r-- | src/vm/comsynchronizable.h | 4 | ||||
-rw-r--r-- | src/vm/comthreadpool.cpp | 22 | ||||
-rw-r--r-- | src/vm/comthreadpool.h | 9 | ||||
-rw-r--r-- | src/vm/delegateinfo.h | 15 | ||||
-rw-r--r-- | src/vm/object.h | 8 |
14 files changed, 34 insertions, 184 deletions
diff --git a/src/mscorlib/src/System/Delegate.cs b/src/mscorlib/src/System/Delegate.cs index e822ff6a32..5cc8bb83af 100644 --- a/src/mscorlib/src/System/Delegate.cs +++ b/src/mscorlib/src/System/Delegate.cs @@ -109,7 +109,7 @@ namespace System RuntimeMethodHandleInternal method = new RuntimeMethodHandleInternal(GetInvokeMethod()); RuntimeMethodInfo invoke = (RuntimeMethodInfo)RuntimeType.GetMethodBase((RuntimeType)this.GetType(), method); - return invoke.UnsafeInvoke(this, BindingFlags.Default, null, args, null); + return invoke.Invoke(this, BindingFlags.Default, null, args, null); } @@ -427,7 +427,6 @@ namespace System } // V1 API. - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static Delegate CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure) { // Validate the parameters. @@ -455,13 +454,11 @@ namespace System // pass us a static method or a method with a non-exact signature // and the only change in behavior from v1.1 there is that we won't // fail the call). - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; Delegate d = CreateDelegateInternal( rtType, rmi, null, - DelegateBindingFlags.OpenDelegateOnly | DelegateBindingFlags.RelaxedSignature, - ref stackMark); + DelegateBindingFlags.OpenDelegateOnly | DelegateBindingFlags.RelaxedSignature); if (d == null && throwOnBindFailure) throw new ArgumentException(SR.Arg_DlgtTargMeth); @@ -476,7 +473,6 @@ namespace System } // V2 API. - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static Delegate CreateDelegate(Type type, Object firstArgument, MethodInfo method, bool throwOnBindFailure) { // Validate the parameters. @@ -501,13 +497,11 @@ namespace System // instance methods with relaxed signature checking. The delegate // can also be closed over null. There's no ambiguity with all these // options since the caller is providing us a specific MethodInfo. - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; Delegate d = CreateDelegateInternal( rtType, rmi, firstArgument, - DelegateBindingFlags.RelaxedSignature, - ref stackMark); + DelegateBindingFlags.RelaxedSignature); if (d == null && throwOnBindFailure) throw new ArgumentException(SR.Arg_DlgtTargMeth); @@ -602,7 +596,7 @@ namespace System // signature changes). We explicitly skip security checks here -- // we're not really constructing a delegate, we're cloning an // existing instance which already passed its checks. - Delegate d = UnsafeCreateDelegate(type, rtMethod, firstArgument, + Delegate d = CreateDelegateInternal(type, rtMethod, firstArgument, DelegateBindingFlags.SkipSecurityChecks | DelegateBindingFlags.RelaxedSignature); @@ -618,14 +612,7 @@ namespace System return CreateDelegate(type, method, true); } - internal static Delegate CreateDelegateInternal(RuntimeType rtType, RuntimeMethodInfo rtMethod, Object firstArgument, DelegateBindingFlags flags, ref StackCrawlMark stackMark) - { - Debug.Assert((flags & DelegateBindingFlags.SkipSecurityChecks) == 0); - - return UnsafeCreateDelegate(rtType, rtMethod, firstArgument, flags); - } - - internal static Delegate UnsafeCreateDelegate(RuntimeType rtType, RuntimeMethodInfo rtMethod, Object firstArgument, DelegateBindingFlags flags) + internal static Delegate CreateDelegateInternal(RuntimeType rtType, RuntimeMethodInfo rtMethod, Object firstArgument, DelegateBindingFlags flags) { Delegate d = InternalAlloc(rtType); diff --git a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs index 23b4793964..0931e3ccdc 100644 --- a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs +++ b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs @@ -117,37 +117,6 @@ namespace System.Reflection return RuntimeAssembly.InternalLoad(assemblyString, ref stackMark); } - // Returns type from the assembly while keeping compatibility with Assembly.Load(assemblyString).GetType(typeName) for managed types. - // Calls Type.GetType for WinRT types. - // Note: Type.GetType fails for assembly names that start with weird characters like '['. By calling it for managed types we would - // break AppCompat. - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod - internal static Type GetType_Compat(String assemblyString, String typeName) - { - // Normally we would get the stackMark only in public APIs. This is internal API, but it is AppCompat replacement of public API - // call Assembly.Load(assemblyString).GetType(typeName), therefore we take the stackMark here as well, to be fully compatible with - // the call sequence. - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - - RuntimeAssembly assembly; - AssemblyName assemblyName = RuntimeAssembly.CreateAssemblyName( - assemblyString, - out assembly); - - if (assembly == null) - { - if (assemblyName.ContentType == AssemblyContentType.WindowsRuntime) - { - return Type.GetType(typeName + ", " + assemblyString, true /*throwOnError*/, false /*ignoreCase*/); - } - - assembly = RuntimeAssembly.InternalLoadAssemblyName( - assemblyName, null, ref stackMark, - true /*thrownOnFileNotFound*/); - } - return assembly.GetType(typeName, true /*throwOnError*/, false /*ignoreCase*/); - } - // Locate an assembly by its name. The name can be strong or // weak. The assembly is loaded into the domain of the caller. [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod diff --git a/src/mscorlib/src/System/Reflection/CustomAttribute.cs b/src/mscorlib/src/System/Reflection/CustomAttribute.cs index afb121a22e..ab928e4024 100644 --- a/src/mscorlib/src/System/Reflection/CustomAttribute.cs +++ b/src/mscorlib/src/System/Reflection/CustomAttribute.cs @@ -1610,7 +1610,7 @@ namespace System.Reflection if (!setMethod.IsPublic) continue; - setMethod.UnsafeInvoke(attribute, BindingFlags.Default, null, new object[] { value }, null); + setMethod.Invoke(attribute, BindingFlags.Default, null, new object[] { value }, null); #endregion } else diff --git a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs index 7c1b0cf77f..9f7d79e248 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs @@ -334,7 +334,6 @@ namespace System.Reflection [DebuggerStepThroughAttribute] [Diagnostics.DebuggerHidden] - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public override Object Invoke( Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { @@ -403,7 +402,6 @@ namespace System.Reflection #region ConstructorInfo Overrides [DebuggerStepThroughAttribute] [Diagnostics.DebuggerHidden] - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public override Object Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { INVOCATION_FLAGS invocationFlags = InvocationFlags; diff --git a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs index 505838fc02..0b4f4f2452 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs @@ -454,27 +454,10 @@ namespace System.Reflection [DebuggerStepThroughAttribute] [Diagnostics.DebuggerHidden] - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { object[] arguments = InvokeArgumentsCheck(obj, invokeAttr, binder, parameters, culture); - return UnsafeInvokeInternal(obj, invokeAttr, parameters, arguments); - } - - [DebuggerStepThroughAttribute] - [Diagnostics.DebuggerHidden] - internal object UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) - { - object[] arguments = InvokeArgumentsCheck(obj, invokeAttr, binder, parameters, culture); - - return UnsafeInvokeInternal(obj, invokeAttr, parameters, arguments); - } - - [DebuggerStepThroughAttribute] - [Diagnostics.DebuggerHidden] - private object UnsafeInvokeInternal(Object obj, BindingFlags invokeAttr, Object[] parameters, Object[] arguments) - { bool wrapExceptions = (invokeAttr & BindingFlags.DoNotWrapExceptions) == 0; if (arguments == null || arguments.Length == 0) return RuntimeMethodHandle.InvokeMethod(obj, null, Signature, false, wrapExceptions); @@ -570,8 +553,6 @@ namespace System.Reflection public override Delegate CreateDelegate(Type delegateType) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - // This API existed in v1/v1.1 and only expected to create closed // instance delegates. Constrain the call to BindToMethodInfo to // open delegates only for backwards compatibility. But we'll allow @@ -583,14 +564,11 @@ namespace System.Reflection return CreateDelegateInternal( delegateType, null, - DelegateBindingFlags.OpenDelegateOnly | DelegateBindingFlags.RelaxedSignature, - ref stackMark); + DelegateBindingFlags.OpenDelegateOnly | DelegateBindingFlags.RelaxedSignature); } public override Delegate CreateDelegate(Type delegateType, Object target) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - // This API is new in Whidbey and allows the full range of delegate // flexability (open or closed delegates binding to static or // instance methods with relaxed signature checking). The delegate @@ -599,11 +577,10 @@ namespace System.Reflection return CreateDelegateInternal( delegateType, target, - DelegateBindingFlags.RelaxedSignature, - ref stackMark); + DelegateBindingFlags.RelaxedSignature); } - private Delegate CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags, ref StackCrawlMark stackMark) + private Delegate CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags) { // Validate the parameters. if (delegateType == null) @@ -616,7 +593,7 @@ namespace System.Reflection if (!rtType.IsDelegate()) throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(delegateType)); - Delegate d = Delegate.CreateDelegateInternal(rtType, this, firstArgument, bindingFlags, ref stackMark); + Delegate d = Delegate.CreateDelegateInternal(rtType, this, firstArgument, bindingFlags); if (d == null) { throw new ArgumentException(SR.Arg_DlgtTargMeth); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs index ae58844273..1d7a5dfb9d 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs @@ -122,7 +122,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // We can safely skip access check because this is only used in full trust scenarios. // And we have already verified that the property accessor is public. - return rtMethod.UnsafeInvoke(target, BindingFlags.Default, null, args, null); + return rtMethod.Invoke(target, BindingFlags.Default, null, args, null); } public Type Type diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs index aea3616e9a..11f754ca3a 100644 --- a/src/mscorlib/src/System/Threading/Thread.cs +++ b/src/mscorlib/src/System/Threading/Thread.cs @@ -139,10 +139,6 @@ namespace System.Threading #pragma warning restore 414 #pragma warning restore 169 - private bool m_ExecutionContextBelongsToOuterScope; -#if DEBUG - private bool m_ForbidExecutionContextMutation; -#endif // Do not move! Order of above fields needs to be preserved for alignment // with native code @@ -233,14 +229,6 @@ namespace System.Threading ** ** Exceptions: ThreadStateException if the thread has already been started. =========================================================================*/ - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod - public new void Start() - { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - Start(ref stackMark); - } - - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public new void Start(object parameter) { //In the case of a null delegate (second call to start on same thread) @@ -253,11 +241,10 @@ namespace System.Threading throw new InvalidOperationException(SR.InvalidOperation_ThreadWrongThreadStart); } m_ThreadStartArg = parameter; - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - Start(ref stackMark); + Start(); } - private void Start(ref StackCrawlMark stackMark) + public new void Start() { #if FEATURE_COMINTEROP_APARTMENT_SUPPORT // Eagerly initialize the COM Apartment state of the thread if we're allowed to. @@ -276,7 +263,7 @@ namespace System.Threading t.SetExecutionContextHelper(ec); } - StartInternal(ref stackMark); + StartInternal(); } internal ExecutionContext ExecutionContext @@ -292,7 +279,7 @@ namespace System.Threading } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern void StartInternal(ref StackCrawlMark stackMark); + private extern void StartInternal(); // Helper method to get a logical thread ID for StringBuilder (for @@ -391,7 +378,6 @@ namespace System.Threading private extern void InternalFinalize(); #if FEATURE_COMINTEROP_APARTMENT_SUPPORT - [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern void StartupSetApartmentStateInternal(); #endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT diff --git a/src/mscorlib/src/System/Threading/ThreadPool.cs b/src/mscorlib/src/System/Threading/ThreadPool.cs index ff174b1ed2..e10212a90c 100644 --- a/src/mscorlib/src/System/Threading/ThreadPool.cs +++ b/src/mscorlib/src/System/Threading/ThreadPool.cs @@ -1149,7 +1149,6 @@ namespace System.Threading } [CLSCompliant(false)] - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle RegisterWaitForSingleObject( // throws RegisterWaitException WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1158,12 +1157,10 @@ namespace System.Threading bool executeOnlyOnce // NOTE: we do not allow other options that allow the callback to be queued as an APC ) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, true); + return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, true); } [CLSCompliant(false)] - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( // throws RegisterWaitException WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1172,8 +1169,7 @@ namespace System.Threading bool executeOnlyOnce // NOTE: we do not allow other options that allow the callback to be queued as an APC ) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, false); + return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, false); } @@ -1183,7 +1179,6 @@ namespace System.Threading Object state, uint millisecondsTimeOutInterval, bool executeOnlyOnce, // NOTE: we do not allow other options that allow the callback to be queued as an APC - ref StackCrawlMark stackMark, bool compressStack ) { @@ -1200,9 +1195,7 @@ namespace System.Threading state, millisecondsTimeOutInterval, executeOnlyOnce, - registeredWaitHandle, - ref stackMark, - compressStack); + registeredWaitHandle); registeredWaitHandle.SetHandle(nativeRegisteredWaitHandle); } else @@ -1213,7 +1206,6 @@ namespace System.Threading } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle RegisterWaitForSingleObject( // throws RegisterWaitException WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1224,11 +1216,9 @@ namespace System.Threading { if (millisecondsTimeOutInterval < -1) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, true); + return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, true); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( // throws RegisterWaitException WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1239,11 +1229,9 @@ namespace System.Threading { if (millisecondsTimeOutInterval < -1) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, false); + return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, false); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle RegisterWaitForSingleObject( // throws RegisterWaitException WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1254,11 +1242,9 @@ namespace System.Threading { if (millisecondsTimeOutInterval < -1) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, true); + return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, true); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( // throws RegisterWaitException WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1269,11 +1255,9 @@ namespace System.Threading { if (millisecondsTimeOutInterval < -1) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, false); + return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, false); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle RegisterWaitForSingleObject( WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1287,11 +1271,9 @@ namespace System.Threading throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); if (tm > (long)Int32.MaxValue) throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal); - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, ref stackMark, true); + return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, true); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( WaitHandle waitObject, WaitOrTimerCallback callBack, @@ -1305,8 +1287,7 @@ namespace System.Threading throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); if (tm > (long)Int32.MaxValue) throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal); - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, ref stackMark, false); + return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, false); } public static bool QueueUserWorkItem(WaitCallback callBack) => @@ -1529,9 +1510,7 @@ namespace System.Threading Object state, uint timeOutInterval, bool executeOnlyOnce, - RegisteredWaitHandle registeredWaitHandle, - ref StackCrawlMark stackMark, - bool compressStack + RegisteredWaitHandle registeredWaitHandle ); diff --git a/src/vm/comsynchronizable.cpp b/src/vm/comsynchronizable.cpp index c0d31f0536..a2cc4f0932 100644 --- a/src/vm/comsynchronizable.cpp +++ b/src/vm/comsynchronizable.cpp @@ -399,20 +399,20 @@ ULONG WINAPI ThreadNative::KickOffThread(void* pass) } -FCIMPL2(void, ThreadNative::Start, ThreadBaseObject* pThisUNSAFE, StackCrawlMark* pStackMark) +FCIMPL1(void, ThreadNative::Start, ThreadBaseObject* pThisUNSAFE) { FCALL_CONTRACT; HELPER_METHOD_FRAME_BEGIN_NOPOLL(); - StartInner(pThisUNSAFE, pStackMark); + StartInner(pThisUNSAFE); HELPER_METHOD_FRAME_END_POLL(); } FCIMPLEND // Start up a thread, which by now should be in the ThreadStore's Unstarted list. -void ThreadNative::StartInner(ThreadBaseObject* pThisUNSAFE, StackCrawlMark* pStackMark) +void ThreadNative::StartInner(ThreadBaseObject* pThisUNSAFE) { CONTRACTL { diff --git a/src/vm/comsynchronizable.h b/src/vm/comsynchronizable.h index 589fce35ab..87321fd336 100644 --- a/src/vm/comsynchronizable.h +++ b/src/vm/comsynchronizable.h @@ -64,11 +64,11 @@ public: static LPVOID F_CALL_CONV FastGetCurrentThread(); static LPVOID F_CALL_CONV FastGetDomain(); - static void StartInner(ThreadBaseObject* pThisUNSAFE, StackCrawlMark* pStackMark); + static void StartInner(ThreadBaseObject* pThisUNSAFE); static FCDECL1(void, Abort, ThreadBaseObject* pThis); static FCDECL1(void, ResetAbort, ThreadBaseObject* pThis); - static FCDECL2(void, Start, ThreadBaseObject* pThisUNSAFE, StackCrawlMark* pStackMark); + static FCDECL1(void, Start, ThreadBaseObject* pThisUNSAFE); static FCDECL1(INT32, GetPriority, ThreadBaseObject* pThisUNSAFE); static FCDECL2(void, SetPriority, ThreadBaseObject* pThisUNSAFE, INT32 iPriority); static FCDECL1(void, Interrupt, ThreadBaseObject* pThisUNSAFE); diff --git a/src/vm/comthreadpool.cpp b/src/vm/comthreadpool.cpp index 6ab6b60013..fcb51dc301 100644 --- a/src/vm/comthreadpool.cpp +++ b/src/vm/comthreadpool.cpp @@ -120,9 +120,6 @@ DelegateInfo *DelegateInfo::MakeDelegateInfo(AppDomain *pAppDomain, else delegateInfo->m_registeredWaitHandle = NULL; - delegateInfo->m_overridesCount = 0; - delegateInfo->m_hasSecurityInfo = FALSE; - delegateInfo.SuppressRelease(); return delegateInfo; @@ -372,20 +369,12 @@ VOID NTAPI RegisterWaitForSingleObjectCallback(PVOID delegateInfo, BOOLEAN Timer return; } -void ThreadPoolNative::Init() -{ - -} - - -FCIMPL7(LPVOID, ThreadPoolNative::CorRegisterWaitForSingleObject, +FCIMPL5(LPVOID, ThreadPoolNative::CorRegisterWaitForSingleObject, Object* waitObjectUNSAFE, Object* stateUNSAFE, UINT32 timeout, CLR_BOOL executeOnlyOnce, - Object* registeredWaitObjectUNSAFE, - StackCrawlMark* stackMark, - CLR_BOOL compressStack) + Object* registeredWaitObjectUNSAFE) { FCALL_CONTRACT; @@ -422,13 +411,6 @@ FCIMPL7(LPVOID, ThreadPoolNative::CorRegisterWaitForSingleObject, (OBJECTREF *)&gc.waitObject, &gc.registeredWaitObject); - if (compressStack) - { - delegateInfo->SetThreadSecurityInfo( pCurThread, stackMark ); - } - - - if (!(ThreadpoolMgr::RegisterWaitForSingleObject(&handle, hWaitHandle, RegisterWaitForSingleObjectCallback, diff --git a/src/vm/comthreadpool.h b/src/vm/comthreadpool.h index 3e01717d7a..6b0f4ec969 100644 --- a/src/vm/comthreadpool.h +++ b/src/vm/comthreadpool.h @@ -23,9 +23,6 @@ class ThreadPoolNative { public: - - static void Init(); - static FCDECL2(FC_BOOL_RET, CorSetMaxThreads, DWORD workerThreads, DWORD completionPortThreads); static FCDECL2(VOID, CorGetMaxThreads, DWORD* workerThreads, DWORD* completionPortThreads); static FCDECL2(FC_BOOL_RET, CorSetMinThreads, DWORD workerThreads, DWORD completionPortThreads); @@ -40,14 +37,12 @@ public: static FCDECL1(void, ReportThreadStatus, CLR_BOOL isWorking); - static FCDECL7(LPVOID, CorRegisterWaitForSingleObject, + static FCDECL5(LPVOID, CorRegisterWaitForSingleObject, Object* waitObjectUNSAFE, Object* stateUNSAFE, UINT32 timeout, CLR_BOOL executeOnlyOnce, - Object* registeredWaitObjectUNSAFE, - StackCrawlMark* stackMark, - CLR_BOOL compressStack); + Object* registeredWaitObjectUNSAFE); static BOOL QCALLTYPE RequestWorkerThread(); diff --git a/src/vm/delegateinfo.h b/src/vm/delegateinfo.h index c8a3e36c2e..80a69a63c3 100644 --- a/src/vm/delegateinfo.h +++ b/src/vm/delegateinfo.h @@ -25,21 +25,6 @@ struct DelegateInfo OBJECTHANDLE m_stateHandle; OBJECTHANDLE m_eventHandle; OBJECTHANDLE m_registeredWaitHandle; - DWORD m_overridesCount; - BOOL m_hasSecurityInfo; - - void SetThreadSecurityInfo( Thread* thread, StackCrawlMark* stackMark ) - { - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_COOPERATIVE; - INJECT_FAULT(COMPlusThrowOM()); - } - CONTRACTL_END; - - - } #ifndef DACCESS_COMPILE void Release() diff --git a/src/vm/object.h b/src/vm/object.h index e6e0c02041..6c342fd917 100644 --- a/src/vm/object.h +++ b/src/vm/object.h @@ -1458,9 +1458,6 @@ private: OBJECTREF m_SynchronizationContext; OBJECTREF m_Name; OBJECTREF m_Delegate; -#ifdef IO_CANCELLATION_ENABLED - OBJECTREF m_CancellationSignals; -#endif OBJECTREF m_ThreadStartArg; // The next field (m_InternalThread) is declared as IntPtr in the managed @@ -1474,11 +1471,6 @@ private: //We need to cache the thread id in managed code for perf reasons. INT32 m_ManagedThreadId; - CLR_BOOL m_ExecutionContextBelongsToCurrentScope; -#ifdef _DEBUG - CLR_BOOL m_ForbidExecutionContextMutation; -#endif - protected: // the ctor and dtor can do no useful work. ThreadBaseObject() {LIMITED_METHOD_CONTRACT;}; |