diff options
Diffstat (limited to 'src/mscorlib/src/System/Threading/SynchronizationContext.cs')
-rw-r--r-- | src/mscorlib/src/System/Threading/SynchronizationContext.cs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/mscorlib/src/System/Threading/SynchronizationContext.cs b/src/mscorlib/src/System/Threading/SynchronizationContext.cs index 5531597229..f4b3c79409 100644 --- a/src/mscorlib/src/System/Threading/SynchronizationContext.cs +++ b/src/mscorlib/src/System/Threading/SynchronizationContext.cs @@ -13,12 +13,9 @@ namespace System.Threading { using Microsoft.Win32.SafeHandles; - using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; -#if FEATURE_CORRUPTING_EXCEPTIONS using System.Runtime.ExceptionServices; -#endif // FEATURE_CORRUPTING_EXCEPTIONS using System.Runtime; using System.Runtime.Versioning; using System.Runtime.ConstrainedExecution; @@ -29,14 +26,12 @@ namespace System.Threading using System.Diagnostics.CodeAnalysis; -#if FEATURE_SYNCHRONIZATIONCONTEXT_WAIT [Flags] enum SynchronizationContextProperties { None = 0, RequireWaitNotification = 0x1 }; -#endif #if FEATURE_COMINTEROP && FEATURE_APPX // @@ -52,15 +47,12 @@ namespace System.Threading public class SynchronizationContext { -#if FEATURE_SYNCHRONIZATIONCONTEXT_WAIT SynchronizationContextProperties _props = SynchronizationContextProperties.None; -#endif public SynchronizationContext() { } -#if FEATURE_SYNCHRONIZATIONCONTEXT_WAIT // helper delegate to statically bind to Wait method private delegate int WaitDelegate(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout); @@ -109,7 +101,6 @@ namespace System.Threading { return ((_props & SynchronizationContextProperties.RequireWaitNotification) != 0); } -#endif public virtual void Send(SendOrPostCallback d, Object state) @@ -137,10 +128,8 @@ namespace System.Threading { } -#if FEATURE_SYNCHRONIZATIONCONTEXT_WAIT // Method called when the CLR does a wait operation [CLSCompliant(false)] - [PrePrepareMethod] public virtual int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) { return WaitHelper(waitHandles, waitAll, millisecondsTimeout); @@ -148,8 +137,6 @@ namespace System.Threading // Method that can be called by Wait overrides [CLSCompliant(false)] - [PrePrepareMethod] - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected static int WaitHelper(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) { if (waitHandles == null) @@ -164,22 +151,14 @@ namespace System.Threading // Static helper to which the above method can delegate to in order to get the default // COM behavior. [CLSCompliant(false)] - [PrePrepareMethod] [MethodImplAttribute(MethodImplOptions.InternalCall)] - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] private static extern int WaitHelperNative(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout); -#endif public static void SetSynchronizationContext(SynchronizationContext syncContext) { Thread.CurrentThread.SynchronizationContext = syncContext; } - public static void SetThreadStaticContext(SynchronizationContext syncContext) - { - Thread.CurrentThread.SynchronizationContext = syncContext; - } - public static SynchronizationContext Current { get @@ -260,11 +239,9 @@ namespace System.Threading return new SynchronizationContext(); } -#if FEATURE_SYNCHRONIZATIONCONTEXT_WAIT private static int InvokeWaitMethodHelper(SynchronizationContext syncContext, IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) { return syncContext.Wait(waitHandles, waitAll, millisecondsTimeout); } -#endif } } |