diff --git a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs index 1ff2ff11e461..3aafe01a2ce1 100644 --- a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs +++ b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs @@ -47,7 +47,6 @@ private Thread AsThread() public bool IsBackground { get { return IsBackgroundNative(); } - [HostProtection(SelfAffectingThreading = true)] set { SetBackgroundNative(value); } } @@ -77,7 +76,6 @@ public bool IsBackground public ThreadPriority Priority { get { return (ThreadPriority)GetPriorityNative(); } - [HostProtection(SelfAffectingThreading = true)] set { SetPriorityNative((int)value); } } @@ -113,7 +111,6 @@ public ApartmentState GetApartmentState() ** An unstarted thread can be marked to indicate that it will host a ** single-threaded or multi-threaded apartment. =========================================================================*/ - [HostProtection(Synchronization = true, SelfAffectingThreading = true)] public bool TrySetApartmentState(ApartmentState state) { #if FEATURE_COMINTEROP_APARTMENT_SUPPORT @@ -184,10 +181,8 @@ public void DisableComObjectEagerCleanup() ** ThreadInterruptedException if the thread is interrupted while waiting. ** ThreadStateException if the thread has not been started yet. =========================================================================*/ - [HostProtection(Synchronization = true, ExternalThreading = true)] public void Join() => JoinInternal(Timeout.Infinite); - [HostProtection(Synchronization = true, ExternalThreading = true)] public bool Join(int millisecondsTimeout) => JoinInternal(millisecondsTimeout); [MethodImpl(MethodImplOptions.InternalCall)] diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs index 058247e42ac4..23631987a5a9 100644 --- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs +++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs @@ -6,7 +6,6 @@ namespace Microsoft.Win32 { using Microsoft.Win32.SafeHandles; using System.Security.Permissions; - [HostProtectionAttribute(MayLeakOnAbort = true)] sealed internal class SafeLibraryHandle : SafeHandleZeroOrMinusOneIsInvalid { internal SafeLibraryHandle() : base(true) {} diff --git a/src/mscorlib/src/System/Collections/ArrayList.cs b/src/mscorlib/src/System/Collections/ArrayList.cs index e784c08766de..e7f121370b6b 100644 --- a/src/mscorlib/src/System/Collections/ArrayList.cs +++ b/src/mscorlib/src/System/Collections/ArrayList.cs @@ -725,7 +725,6 @@ public virtual void Sort(IComparer comparer) // Returns a thread-safe wrapper around an IList. // - [HostProtection(Synchronization=true)] public static IList Synchronized(IList list) { if (list==null) throw new ArgumentNullException(nameof(list)); @@ -736,7 +735,6 @@ public virtual void Sort(IComparer comparer) // Returns a thread-safe wrapper around a ArrayList. // - [HostProtection(Synchronization=true)] public static ArrayList Synchronized(ArrayList list) { if (list==null) throw new ArgumentNullException(nameof(list)); diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs index 6f465896a8ae..c1a6f7564c6a 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs @@ -40,7 +40,6 @@ namespace System.Collections.Concurrent [ComVisible(false)] [DebuggerTypeProxy(typeof(Mscorlib_DictionaryDebugView<,>))] [DebuggerDisplay("Count = {Count}")] - [HostProtection(Synchronization = true, ExternalThreading = true)] public class ConcurrentDictionary : IDictionary, IDictionary, IReadOnlyDictionary { /// diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs index 4069a6b7b108..7aa597169056 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs @@ -38,7 +38,6 @@ namespace System.Collections.Concurrent [ComVisible(false)] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView<>))] - [HostProtection(Synchronization = true, ExternalThreading = true)] [Serializable] public class ConcurrentQueue : IProducerConsumerCollection, IReadOnlyCollection { diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs index c97e0f682380..c36d96c26c39 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs @@ -45,7 +45,6 @@ namespace System.Collections.Concurrent /// [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView<>))] - [HostProtection(Synchronization = true, ExternalThreading = true)] public class ConcurrentStack : IProducerConsumerCollection, IReadOnlyCollection { /// diff --git a/src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs b/src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs index 02263b7f97dc..33e3c88e9a6d 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs @@ -61,7 +61,6 @@ namespace System.Collections.Concurrent /// /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public abstract class OrderablePartitioner : Partitioner { /// diff --git a/src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs b/src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs index 3d54c1471b41..0192b1942c27 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs @@ -44,7 +44,6 @@ namespace System.Collections.Concurrent /// /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public abstract class Partitioner { /// diff --git a/src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs b/src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs index a946abf5a6b8..9b36c053adb5 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs @@ -69,7 +69,6 @@ public enum EnumerablePartitionerOptions /// thread. /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public static class Partitioner { /// diff --git a/src/mscorlib/src/System/Collections/Hashtable.cs b/src/mscorlib/src/System/Collections/Hashtable.cs index 0b3a6b015f38..d4c7d8d673e3 100644 --- a/src/mscorlib/src/System/Collections/Hashtable.cs +++ b/src/mscorlib/src/System/Collections/Hashtable.cs @@ -1046,7 +1046,6 @@ private void putEntry (bucket[] newBuckets, Object key, Object nvalue, int hashc // Returns a thread-safe wrapper for a Hashtable. // - [HostProtection(Synchronization=true)] public static Hashtable Synchronized(Hashtable table) { if (table==null) throw new ArgumentNullException(nameof(table)); diff --git a/src/mscorlib/src/System/Collections/SortedList.cs b/src/mscorlib/src/System/Collections/SortedList.cs index 0f6ab62d6b11..4a480a2c3745 100644 --- a/src/mscorlib/src/System/Collections/SortedList.cs +++ b/src/mscorlib/src/System/Collections/SortedList.cs @@ -528,7 +528,6 @@ public virtual Object Clone() // Returns a thread-safe SortedList. // - [HostProtection(Synchronization=true)] public static SortedList Synchronized(SortedList list) { if (list==null) throw new ArgumentNullException(nameof(list)); diff --git a/src/mscorlib/src/System/Collections/Stack.cs b/src/mscorlib/src/System/Collections/Stack.cs index d36c8e93cbcc..c3ad15abd88c 100644 --- a/src/mscorlib/src/System/Collections/Stack.cs +++ b/src/mscorlib/src/System/Collections/Stack.cs @@ -189,7 +189,6 @@ public Stack(ICollection col) : this((col==null ? 32 : col.Count)) // Returns a synchronized Stack. // - [HostProtection(Synchronization=true)] public static Stack Synchronized(Stack stack) { if (stack==null) throw new ArgumentNullException(nameof(stack)); diff --git a/src/mscorlib/src/System/Diagnostics/log.cs b/src/mscorlib/src/System/Diagnostics/log.cs index 6c438c92e9e2..6916ce3a0a86 100644 --- a/src/mscorlib/src/System/Diagnostics/log.cs +++ b/src/mscorlib/src/System/Diagnostics/log.cs @@ -22,7 +22,6 @@ namespace System.Diagnostics { // programatically, by registry (specifics....) or environment // variables. [Serializable] - [HostProtection(Synchronization=true, ExternalThreading=true)] internal delegate void LogMessageEventHandler(LoggingLevels level, LogSwitch category, String message, StackTrace location); diff --git a/src/mscorlib/src/System/IO/MemoryStream.cs b/src/mscorlib/src/System/IO/MemoryStream.cs index 5dde00d18e04..bdddc8381802 100644 --- a/src/mscorlib/src/System/IO/MemoryStream.cs +++ b/src/mscorlib/src/System/IO/MemoryStream.cs @@ -181,7 +181,6 @@ protected override void Dispose(bool disposing) public override void Flush() { } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public override Task FlushAsync(CancellationToken cancellationToken) { @@ -358,7 +357,6 @@ internal void InternalGetOriginAndLength(out int origin, out int length) return n; } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task ReadAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken) { @@ -591,7 +589,6 @@ public override void CopyTo(Stream destination, int bufferSize) } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken) { diff --git a/src/mscorlib/src/System/IO/Stream.cs b/src/mscorlib/src/System/IO/Stream.cs index f1a3198fd99f..3cdfad613ef5 100644 --- a/src/mscorlib/src/System/IO/Stream.cs +++ b/src/mscorlib/src/System/IO/Stream.cs @@ -109,7 +109,6 @@ internal SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized() } } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public Task CopyToAsync(Stream destination) { @@ -147,14 +146,12 @@ public Task CopyToAsync(Stream destination) return CopyToAsync(destination, bufferSize); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public Task CopyToAsync(Stream destination, Int32 bufferSize) { return CopyToAsync(destination, bufferSize, CancellationToken.None); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task CopyToAsync(Stream destination, Int32 bufferSize, CancellationToken cancellationToken) { @@ -281,14 +278,12 @@ protected virtual void Dispose(bool disposing) public abstract void Flush(); - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public Task FlushAsync() { return FlushAsync(CancellationToken.None); } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public virtual Task FlushAsync(CancellationToken cancellationToken) { @@ -303,14 +298,12 @@ protected virtual WaitHandle CreateWaitHandle() return new ManualResetEvent(false); } - [HostProtection(ExternalThreading=true)] public virtual IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { Contract.Ensures(Contract.Result() != null); return BeginReadInternal(buffer, offset, count, callback, state, serializeAsynchronously: false, apm: true); } - [HostProtection(ExternalThreading = true)] internal IAsyncResult BeginReadInternal( byte[] buffer, int offset, int count, AsyncCallback callback, Object state, bool serializeAsynchronously, bool apm) @@ -405,14 +398,12 @@ public virtual int EndRead(IAsyncResult asyncResult) } } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public Task ReadAsync(Byte[] buffer, int offset, int count) { return ReadAsync(buffer, offset, count, CancellationToken.None); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task ReadAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken) { @@ -451,14 +442,12 @@ private struct ReadWriteParameters // struct for arguments to Read and Write cal - [HostProtection(ExternalThreading=true)] public virtual IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { Contract.Ensures(Contract.Result() != null); return BeginWriteInternal(buffer, offset, count, callback, state, serializeAsynchronously: false, apm: true); } - [HostProtection(ExternalThreading = true)] internal IAsyncResult BeginWriteInternal( byte[] buffer, int offset, int count, AsyncCallback callback, Object state, bool serializeAsynchronously, bool apm) @@ -701,7 +690,6 @@ void ITaskCompletionAction.Invoke(Task completingTask) bool ITaskCompletionAction.InvokeMayRunArbitraryCode { get { return true; } } } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public Task WriteAsync(Byte[] buffer, int offset, int count) { @@ -710,7 +698,6 @@ public Task WriteAsync(Byte[] buffer, int offset, int count) - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken) { @@ -782,7 +769,6 @@ public virtual void WriteByte(byte value) Write(oneByteArray, 0, 1); } - [HostProtection(Synchronization=true)] public static Stream Synchronized(Stream stream) { if (stream==null) @@ -928,7 +914,6 @@ public override Task FlushAsync(CancellationToken cancellationToken) Task.CompletedTask; } - [HostProtection(ExternalThreading = true)] public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { if (!CanRead) __Error.ReadNotSupported(); @@ -945,7 +930,6 @@ public override int EndRead(IAsyncResult asyncResult) return BlockingEndRead(asyncResult); } - [HostProtection(ExternalThreading = true)] public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { if (!CanWrite) __Error.WriteNotSupported(); @@ -1217,7 +1201,6 @@ public override int ReadByte() return _stream.ReadByte(); } - [HostProtection(ExternalThreading=true)] public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { bool overridesBeginRead = _stream.HasOverriddenBeginEndRead(); @@ -1271,7 +1254,6 @@ public override void WriteByte(byte b) _stream.WriteByte(b); } - [HostProtection(ExternalThreading=true)] public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { bool overridesBeginWrite = _stream.HasOverriddenBeginEndWrite(); diff --git a/src/mscorlib/src/System/IO/StreamReader.cs b/src/mscorlib/src/System/IO/StreamReader.cs index c8a502660fc1..33cca92abe61 100644 --- a/src/mscorlib/src/System/IO/StreamReader.cs +++ b/src/mscorlib/src/System/IO/StreamReader.cs @@ -774,7 +774,6 @@ public override String ReadLine() } #region Task based Async APIs - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public override Task ReadLineAsync() { @@ -855,7 +854,6 @@ private async Task ReadLineAsyncInternal() return GetStringAndReleaseSharedStringBuilder(sb); } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public override Task ReadToEndAsync() { @@ -892,7 +890,6 @@ private async Task ReadToEndAsyncInternal() return GetStringAndReleaseSharedStringBuilder(sb); } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public override Task ReadAsync(char[] buffer, int index, int count) { @@ -1080,7 +1077,6 @@ internal override async Task ReadAsyncInternal(char[] buffer, int index, in return charsRead; } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public override Task ReadBlockAsync(char[] buffer, int index, int count) { diff --git a/src/mscorlib/src/System/IO/StreamWriter.cs b/src/mscorlib/src/System/IO/StreamWriter.cs index 470e8912a465..49415d641e8d 100644 --- a/src/mscorlib/src/System/IO/StreamWriter.cs +++ b/src/mscorlib/src/System/IO/StreamWriter.cs @@ -395,7 +395,6 @@ public override void Write(String value) } #region Task based Async APIs - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteAsync(char value) { @@ -457,7 +456,6 @@ public override Task WriteAsync(char value) _this.CharPos_Prop = charPos; } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteAsync(String value) { @@ -543,7 +541,6 @@ public override Task WriteAsync(String value) _this.CharPos_Prop = charPos; } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteAsync(char[] buffer, int index, int count) { @@ -631,7 +628,6 @@ public override Task WriteAsync(char[] buffer, int index, int count) _this.CharPos_Prop = charPos; } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteLineAsync() { @@ -654,7 +650,6 @@ public override Task WriteLineAsync() } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteLineAsync(char value) { @@ -677,7 +672,6 @@ public override Task WriteLineAsync(char value) } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteLineAsync(String value) { @@ -700,7 +694,6 @@ public override Task WriteLineAsync(String value) } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteLineAsync(char[] buffer, int index, int count) { @@ -733,7 +726,6 @@ public override Task WriteLineAsync(char[] buffer, int index, int count) } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task FlushAsync() { diff --git a/src/mscorlib/src/System/IO/TextReader.cs b/src/mscorlib/src/System/IO/TextReader.cs index d5e5a52e0715..ca05fa4f2b42 100644 --- a/src/mscorlib/src/System/IO/TextReader.cs +++ b/src/mscorlib/src/System/IO/TextReader.cs @@ -172,7 +172,6 @@ public virtual String ReadLine() } #region Task based Async APIs - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public virtual Task ReadLineAsync() { @@ -183,7 +182,6 @@ public virtual Task ReadLineAsync() this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public async virtual Task ReadToEndAsync() { @@ -197,7 +195,6 @@ public async virtual Task ReadToEndAsync() return sb.ToString(); } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public virtual Task ReadAsync(char[] buffer, int index, int count) { @@ -228,7 +225,6 @@ internal virtual Task ReadAsyncInternal(char[] buffer, int index, int count tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public virtual Task ReadBlockAsync(char[] buffer, int index, int count) { @@ -244,7 +240,6 @@ public virtual Task ReadBlockAsync(char[] buffer, int index, int count) return ReadBlockAsyncInternal(buffer, index, count); } - [HostProtection(ExternalThreading=true)] private async Task ReadBlockAsyncInternal(char[] buffer, int index, int count) { Contract.Requires(buffer != null); @@ -263,7 +258,6 @@ private async Task ReadBlockAsyncInternal(char[] buffer, int index, int cou } #endregion - [HostProtection(Synchronization=true)] public static TextReader Synchronized(TextReader reader) { if (reader==null) diff --git a/src/mscorlib/src/System/IO/TextWriter.cs b/src/mscorlib/src/System/IO/TextWriter.cs index de1bb0c29f02..5b460a568390 100644 --- a/src/mscorlib/src/System/IO/TextWriter.cs +++ b/src/mscorlib/src/System/IO/TextWriter.cs @@ -124,7 +124,6 @@ public void Dispose() } - [HostProtection(Synchronization=true)] public static TextWriter Synchronized(TextWriter writer) { if (writer==null) throw new ArgumentNullException(nameof(writer)); @@ -486,7 +485,6 @@ public virtual void WriteLine (String format, params Object[] arg) } #region Task based Async APIs - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteAsync(char value) { @@ -499,7 +497,6 @@ public virtual Task WriteAsync(char value) tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteAsync(String value) { @@ -512,7 +509,6 @@ public virtual Task WriteAsync(String value) tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public Task WriteAsync(char[] buffer) { @@ -520,7 +516,6 @@ public Task WriteAsync(char[] buffer) return WriteAsync(buffer, 0, buffer.Length); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteAsync(char[] buffer, int index, int count) { @@ -533,7 +528,6 @@ public virtual Task WriteAsync(char[] buffer, int index, int count) tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteLineAsync(char value) { @@ -546,7 +540,6 @@ public virtual Task WriteLineAsync(char value) tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteLineAsync(String value) { @@ -559,7 +552,6 @@ public virtual Task WriteLineAsync(String value) tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public Task WriteLineAsync(char[] buffer) { @@ -567,7 +559,6 @@ public Task WriteLineAsync(char[] buffer) return WriteLineAsync(buffer, 0, buffer.Length); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteLineAsync(char[] buffer, int index, int count) { @@ -580,14 +571,12 @@ public virtual Task WriteLineAsync(char[] buffer, int index, int count) tuple, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task WriteLineAsync() { return WriteAsync(CoreNewLine); } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public virtual Task FlushAsync() { diff --git a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs b/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs index f73b5d041fb2..d78632639bb6 100644 --- a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs +++ b/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs @@ -265,7 +265,6 @@ protected override void Dispose(bool disposing) if (!_isOpen) __Error.StreamIsClosed(); } - [HostProtection(ExternalThreading=true)] [ComVisible(false)] public override Task FlushAsync(CancellationToken cancellationToken) { @@ -422,7 +421,6 @@ protected override void Dispose(bool disposing) return nInt; } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) { if (buffer==null) @@ -620,7 +618,6 @@ protected override void Dispose(bool disposing) return; } - [HostProtection(ExternalThreading = true)] [ComVisible(false)] public override Task WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) { diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs index a7d17185839a..9331ae193c2d 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs @@ -156,7 +156,6 @@ public override String ImageRuntimeVersion // AssemblyBuilder class. // deliberately not [serializable] - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_AssemblyBuilder))] [ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs index a4df0e94e7d1..ef76adcf8010 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs @@ -16,7 +16,6 @@ namespace System.Reflection.Emit using System.Runtime.InteropServices; using System.Diagnostics.Contracts; - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_ConstructorBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs index 1577f1188fe4..545657a053a3 100644 --- a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs @@ -25,7 +25,6 @@ namespace System.Reflection.Emit { using System.Diagnostics; using System.Diagnostics.Contracts; - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_CustomAttributeBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs index 05508865fbd2..82dc2828ca4c 100644 --- a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs @@ -23,7 +23,6 @@ namespace System.Reflection.Emit { using System.Security.Permissions; - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_EnumBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/EventBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/EventBuilder.cs index 031528089835..449b20824cd5 100644 --- a/src/mscorlib/src/System/Reflection/Emit/EventBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/EventBuilder.cs @@ -24,7 +24,6 @@ namespace System.Reflection.Emit { // A EventBuilder is always associated with a TypeBuilder. The TypeBuilder.DefineEvent // method will return a new EventBuilder to a client. // - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_EventBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs index 1702c7c47172..595d60ada0dd 100644 --- a/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs @@ -13,7 +13,6 @@ namespace System.Reflection.Emit using System.Security.Permissions; using System.Diagnostics.Contracts; - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_FieldBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs index 8defdfa62cd6..654e166a05d7 100644 --- a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs @@ -19,7 +19,6 @@ namespace System.Reflection.Emit using System.Diagnostics; using System.Diagnostics.Contracts; - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_MethodBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs index 46ea6cde2fe8..6884f50b0e66 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -50,7 +50,6 @@ public override bool Equals(object obj) } // deliberately not [serializable] - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_ModuleBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs index 00de84c60174..e7442b4e02f3 100644 --- a/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs @@ -25,7 +25,6 @@ namespace System.Reflection.Emit { // A PropertyBuilder is always associated with a TypeBuilder. The TypeBuilder.DefineProperty // method will return a new PropertyBuilder to a client. // - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_PropertyBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs index f6c101869a4f..73778d5f2736 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs @@ -35,7 +35,6 @@ public enum PackingSize Size128 = 128, } - [HostProtection(MayLeakOnAbort = true)] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_TypeBuilder))] [System.Runtime.InteropServices.ComVisible(true)] diff --git a/src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs b/src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs index 09eac3a27234..28e95e24560a 100644 --- a/src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs +++ b/src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs @@ -10,7 +10,6 @@ namespace System.Reflection.Emit // This class is describing the fieldmarshal. [Serializable] - [HostProtection(MayLeakOnAbort = true)] [System.Runtime.InteropServices.ComVisible(true)] [Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")] public sealed class UnmanagedMarshal diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs b/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs index 2723fcf79167..6a16462383f3 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @@ -32,7 +32,6 @@ namespace System.Runtime.CompilerServices /// Provides a builder for asynchronous methods that return void. /// This type is intended for compiler use only. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct AsyncVoidMethodBuilder { /// The synchronization context associated with this operation. @@ -271,7 +270,6 @@ private Task Task /// Prior to being copied, one of its Task, SetResult, or SetException members must be accessed, /// or else the copies may end up building distinct Task instances. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct AsyncTaskMethodBuilder { /// A cached VoidTaskResult task used for builders that complete synchronously. @@ -418,7 +416,6 @@ internal void SetNotificationForWaitCompletion(bool enabled) /// Prior to being copied, one of its Task, SetResult, or SetException members must be accessed, /// or else the copies may end up building distinct Task instances. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct AsyncTaskMethodBuilder { /// A cached task for default(TResult). diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs b/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs index 61aa077c6b07..98a81ea470b7 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs @@ -57,7 +57,6 @@ namespace System.Runtime.CompilerServices { /// Provides an awaiter for awaiting a . /// This type is intended for compiler use only. - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct TaskAwaiter : ICriticalNotifyCompletion { /// The task being awaited. @@ -291,7 +290,6 @@ private static Action OutputWaitEtwEvents(Task task, Action continuation) /// Provides an awaiter for awaiting a . /// This type is intended for compiler use only. - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct TaskAwaiter : ICriticalNotifyCompletion { /// The task being awaited. @@ -372,7 +370,6 @@ public ConfiguredTaskAwaitable.ConfiguredTaskAwaiter GetAwaiter() /// Provides an awaiter for a . /// This type is intended for compiler use only. - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct ConfiguredTaskAwaiter : ICriticalNotifyCompletion { /// The task being awaited. @@ -459,7 +456,6 @@ public ConfiguredTaskAwaitable.ConfiguredTaskAwaiter GetAwaiter() /// Provides an awaiter for a . /// This type is intended for compiler use only. - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct ConfiguredTaskAwaiter : ICriticalNotifyCompletion { /// The task being awaited. diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/YieldAwaitable.cs b/src/mscorlib/src/System/Runtime/CompilerServices/YieldAwaitable.cs index 5881b6414fe8..86789bf12d5a 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/YieldAwaitable.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/YieldAwaitable.cs @@ -48,7 +48,6 @@ public struct YieldAwaitable /// Provides an awaiter that switches into a target environment. /// This type is intended for compiler use only. - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct YieldAwaiter : ICriticalNotifyCompletion { /// Gets whether a yield is not required. diff --git a/src/mscorlib/src/System/Runtime/GcSettings.cs b/src/mscorlib/src/System/Runtime/GcSettings.cs index fc70183508cc..91997f5297b8 100644 --- a/src/mscorlib/src/System/Runtime/GcSettings.cs +++ b/src/mscorlib/src/System/Runtime/GcSettings.cs @@ -47,7 +47,6 @@ public static GCLatencyMode LatencyMode } // We don't want to allow this API when hosted. - [HostProtection(MayLeakOnAbort = true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] set { @@ -71,7 +70,6 @@ public static GCLargeObjectHeapCompactionMode LargeObjectHeapCompactionMode } // We don't want to allow this API when hosted. - [HostProtection(MayLeakOnAbort = true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] set { diff --git a/src/mscorlib/src/System/Threading/AutoResetEvent.cs b/src/mscorlib/src/System/Threading/AutoResetEvent.cs index 6fe6c062323a..78a6fa12343d 100644 --- a/src/mscorlib/src/System/Threading/AutoResetEvent.cs +++ b/src/mscorlib/src/System/Threading/AutoResetEvent.cs @@ -17,7 +17,6 @@ namespace System.Threading { using System.Security.Permissions; using System.Runtime.InteropServices; - [HostProtection(Synchronization=true, ExternalThreading=true)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class AutoResetEvent : EventWaitHandle { diff --git a/src/mscorlib/src/System/Threading/CancellationToken.cs b/src/mscorlib/src/System/Threading/CancellationToken.cs index fc767988ed90..5b78f20900f1 100644 --- a/src/mscorlib/src/System/Threading/CancellationToken.cs +++ b/src/mscorlib/src/System/Threading/CancellationToken.cs @@ -39,7 +39,6 @@ namespace System.Threading /// /// [ComVisible(false)] - [HostProtection(Synchronization = true, ExternalThreading = true)] [DebuggerDisplay("IsCancellationRequested = {IsCancellationRequested}")] public struct CancellationToken { diff --git a/src/mscorlib/src/System/Threading/CancellationTokenRegistration.cs b/src/mscorlib/src/System/Threading/CancellationTokenRegistration.cs index 34e0bb0aba12..ac27fe30e66d 100644 --- a/src/mscorlib/src/System/Threading/CancellationTokenRegistration.cs +++ b/src/mscorlib/src/System/Threading/CancellationTokenRegistration.cs @@ -17,7 +17,6 @@ namespace System.Threading /// /// To unregister a callback, dispose the corresponding Registration instance. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct CancellationTokenRegistration : IEquatable, IDisposable { private readonly CancellationCallbackInfo m_callbackInfo; diff --git a/src/mscorlib/src/System/Threading/CancellationTokenSource.cs b/src/mscorlib/src/System/Threading/CancellationTokenSource.cs index d1f0039a1a1a..fe9e0dec7671 100644 --- a/src/mscorlib/src/System/Threading/CancellationTokenSource.cs +++ b/src/mscorlib/src/System/Threading/CancellationTokenSource.cs @@ -36,7 +36,6 @@ namespace System.Threading /// /// [ComVisible(false)] - [HostProtection(Synchronization = true, ExternalThreading = true)] public class CancellationTokenSource : IDisposable { diff --git a/src/mscorlib/src/System/Threading/CountdownEvent.cs b/src/mscorlib/src/System/Threading/CountdownEvent.cs index f984fb351ca9..d86a2ccfb880 100644 --- a/src/mscorlib/src/System/Threading/CountdownEvent.cs +++ b/src/mscorlib/src/System/Threading/CountdownEvent.cs @@ -32,7 +32,6 @@ namespace System.Threading /// [ComVisible(false)] [DebuggerDisplay("Initial Count={InitialCount}, Current Count={CurrentCount}")] - [HostProtection(Synchronization = true, ExternalThreading = true)] public class CountdownEvent : IDisposable { // CountdownEvent is a simple synchronization primitive used for fork/join parallelism. We create a diff --git a/src/mscorlib/src/System/Threading/EventWaitHandle.cs b/src/mscorlib/src/System/Threading/EventWaitHandle.cs index faaafff47ab6..4b1611c6aaf6 100644 --- a/src/mscorlib/src/System/Threading/EventWaitHandle.cs +++ b/src/mscorlib/src/System/Threading/EventWaitHandle.cs @@ -37,7 +37,6 @@ namespace System.Threading using System.Security.AccessControl; using System.Diagnostics.Contracts; - [HostProtection(Synchronization=true, ExternalThreading=true)] [ComVisibleAttribute(true)] public class EventWaitHandle : WaitHandle { diff --git a/src/mscorlib/src/System/Threading/LazyInitializer.cs b/src/mscorlib/src/System/Threading/LazyInitializer.cs index 36f2cec82e5e..238cc89dbdfa 100644 --- a/src/mscorlib/src/System/Threading/LazyInitializer.cs +++ b/src/mscorlib/src/System/Threading/LazyInitializer.cs @@ -55,7 +55,6 @@ public enum LazyThreadSafetyMode /// These routines avoid needing to allocate a dedicated, lazy-initialization instance, instead using /// references to ensure targets have been initialized as they are accessed. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public static class LazyInitializer { /// diff --git a/src/mscorlib/src/System/Threading/ManualResetEvent.cs b/src/mscorlib/src/System/Threading/ManualResetEvent.cs index 504cfb423cf9..00041567dfa3 100644 --- a/src/mscorlib/src/System/Threading/ManualResetEvent.cs +++ b/src/mscorlib/src/System/Threading/ManualResetEvent.cs @@ -17,7 +17,6 @@ namespace System.Threading { using System.Security.Permissions; using System.Runtime.InteropServices; - [HostProtection(Synchronization=true, ExternalThreading=true)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ManualResetEvent : EventWaitHandle { diff --git a/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs b/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs index dc83fac391f8..509af5bfa04e 100644 --- a/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs +++ b/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs @@ -47,7 +47,6 @@ namespace System.Threading /// [ComVisible(false)] [DebuggerDisplay("Set = {IsSet}")] - [HostProtection(Synchronization = true, ExternalThreading = true)] public class ManualResetEventSlim : IDisposable { // These are the default spin counts we use on single-proc and MP machines. diff --git a/src/mscorlib/src/System/Threading/Monitor.cs b/src/mscorlib/src/System/Threading/Monitor.cs index bb0c59210f9b..94dec13d0562 100644 --- a/src/mscorlib/src/System/Threading/Monitor.cs +++ b/src/mscorlib/src/System/Threading/Monitor.cs @@ -27,7 +27,6 @@ namespace System.Threading { using System.Diagnostics; using System.Diagnostics.Contracts; - [HostProtection(Synchronization=true, ExternalThreading=true)] [System.Runtime.InteropServices.ComVisible(true)] public static class Monitor { diff --git a/src/mscorlib/src/System/Threading/Mutex.cs b/src/mscorlib/src/System/Threading/Mutex.cs index dba5df016bf6..506abb7a07a8 100644 --- a/src/mscorlib/src/System/Threading/Mutex.cs +++ b/src/mscorlib/src/System/Threading/Mutex.cs @@ -27,7 +27,6 @@ namespace System.Threading using System.Diagnostics; using System.Diagnostics.Contracts; - [HostProtection(Synchronization=true, ExternalThreading=true)] [ComVisible(true)] public sealed class Mutex : WaitHandle { diff --git a/src/mscorlib/src/System/Threading/ReaderWriterLock.cs b/src/mscorlib/src/System/Threading/ReaderWriterLock.cs index 65127fb202f2..e35ac7685b36 100644 --- a/src/mscorlib/src/System/Threading/ReaderWriterLock.cs +++ b/src/mscorlib/src/System/Threading/ReaderWriterLock.cs @@ -25,7 +25,6 @@ namespace System.Threading { using System.Runtime.Versioning; using System.Diagnostics.Contracts; - [HostProtection(Synchronization=true, ExternalThreading=true)] [ComVisible(true)] public sealed class ReaderWriterLock: CriticalFinalizerObject { diff --git a/src/mscorlib/src/System/Threading/SemaphoreSlim.cs b/src/mscorlib/src/System/Threading/SemaphoreSlim.cs index a04e43d49972..92d760d77d89 100644 --- a/src/mscorlib/src/System/Threading/SemaphoreSlim.cs +++ b/src/mscorlib/src/System/Threading/SemaphoreSlim.cs @@ -40,7 +40,6 @@ namespace System.Threading /// /// [ComVisible(false)] - [HostProtection(Synchronization = true, ExternalThreading = true)] [DebuggerDisplay("Current Count = {m_currentCount}")] public class SemaphoreSlim : IDisposable { diff --git a/src/mscorlib/src/System/Threading/SpinLock.cs b/src/mscorlib/src/System/Threading/SpinLock.cs index 998ea38fd37d..1d90890d6ebf 100644 --- a/src/mscorlib/src/System/Threading/SpinLock.cs +++ b/src/mscorlib/src/System/Threading/SpinLock.cs @@ -55,7 +55,6 @@ namespace System.Threading /// /// [ComVisible(false)] - [HostProtection(Synchronization = true, ExternalThreading = true)] [DebuggerTypeProxy(typeof(SystemThreading_SpinLockDebugView))] [DebuggerDisplay("IsHeld = {IsHeld}")] public struct SpinLock diff --git a/src/mscorlib/src/System/Threading/SpinWait.cs b/src/mscorlib/src/System/Threading/SpinWait.cs index da913ea9e68b..1b31407e0f45 100644 --- a/src/mscorlib/src/System/Threading/SpinWait.cs +++ b/src/mscorlib/src/System/Threading/SpinWait.cs @@ -70,7 +70,6 @@ namespace System.Threading /// threads must spin, each should use its own instance of SpinWait. /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public struct SpinWait { diff --git a/src/mscorlib/src/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs b/src/mscorlib/src/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs index 48e0f4e7cf1a..c7a96b0394aa 100644 --- a/src/mscorlib/src/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs +++ b/src/mscorlib/src/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs @@ -28,7 +28,6 @@ namespace System.Threading.Tasks /// Provides concurrent and exclusive task schedulers that coordinate to execute /// tasks while ensuring that concurrent tasks may run concurrently and exclusive tasks never do. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] [DebuggerDisplay("Concurrent={ConcurrentTaskCountForDebugger}, Exclusive={ExclusiveTaskCountForDebugger}, Mode={ModeForDebugger}")] [DebuggerTypeProxy(typeof(ConcurrentExclusiveSchedulerPair.DebugView))] public class ConcurrentExclusiveSchedulerPair diff --git a/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs b/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs index 974d42783038..c98e219e8686 100644 --- a/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs +++ b/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs @@ -39,7 +39,6 @@ namespace System.Threading.Tasks /// Task{TResult}.Factory property. /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public class TaskFactory { // Member variables, DefaultScheduler, other properties and ctors diff --git a/src/mscorlib/src/System/Threading/Tasks/Parallel.cs b/src/mscorlib/src/System/Threading/Tasks/Parallel.cs index ae785593f85c..7808943870ee 100644 --- a/src/mscorlib/src/System/Threading/Tasks/Parallel.cs +++ b/src/mscorlib/src/System/Threading/Tasks/Parallel.cs @@ -142,7 +142,6 @@ internal int EffectiveMaxConcurrencyLevel /// The class provides library-based data parallel replacements /// for common operations such as for loops, for each loops, and execution of a set of statements. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public static class Parallel { // static counter for generating unique Fork/Join Context IDs to be used in ETW events diff --git a/src/mscorlib/src/System/Threading/Tasks/ParallelLoopState.cs b/src/mscorlib/src/System/Threading/Tasks/ParallelLoopState.cs index 4e9755569ada..6a62cf897731 100644 --- a/src/mscorlib/src/System/Threading/Tasks/ParallelLoopState.cs +++ b/src/mscorlib/src/System/Threading/Tasks/ParallelLoopState.cs @@ -26,7 +26,6 @@ namespace System.Threading.Tasks /// Enables iterations of loops to interact with /// other iterations. /// - [HostProtection(Synchronization = true, ExternalThreading = true)] [DebuggerDisplay("ShouldExitCurrentIteration = {ShouldExitCurrentIteration}")] public class ParallelLoopState { diff --git a/src/mscorlib/src/System/Threading/Tasks/Task.cs b/src/mscorlib/src/System/Threading/Tasks/Task.cs index 865ea131c2b2..cf081f75fd4c 100644 --- a/src/mscorlib/src/System/Threading/Tasks/Task.cs +++ b/src/mscorlib/src/System/Threading/Tasks/Task.cs @@ -137,7 +137,6 @@ public enum TaskStatus /// InternalWait method serves a potential marker for when a Task is entering a wait operation. /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] [DebuggerTypeProxy(typeof(SystemThreadingTasks_TaskDebugView))] [DebuggerDisplay("Id = {Id}, Status = {Status}, Method = {DebuggerDisplayMethodDescription}")] public class Task : IThreadPoolWorkItem, IAsyncResult, IDisposable diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs b/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs index 822ac9b7acfc..320f704f09c2 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs @@ -48,7 +48,6 @@ namespace System.Threading.Tasks /// /// The type of the result value assocatied with this . - [HostProtection(Synchronization = true, ExternalThreading = true)] public class TaskCompletionSource { private readonly Task m_task; diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs b/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs index 9e3bd2ec1f5a..aa4c2df74b7c 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs @@ -38,7 +38,6 @@ namespace System.Threading.Tasks /// Task.Factory property. /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] public class TaskFactory { // member variables diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs b/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs index 6ff7ceb41d84..fad3fc06c565 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs @@ -41,7 +41,6 @@ namespace System.Threading.Tasks /// [DebuggerDisplay("Id={Id}")] [DebuggerTypeProxy(typeof(SystemThreadingTasks_TaskSchedulerDebugView))] - [HostProtection(Synchronization = true, ExternalThreading = true)] public abstract class TaskScheduler { //////////////////////////////////////////////////////////// diff --git a/src/mscorlib/src/System/Threading/Tasks/future.cs b/src/mscorlib/src/System/Threading/Tasks/future.cs index 5a250966ab8b..0c3fec89b73f 100644 --- a/src/mscorlib/src/System/Threading/Tasks/future.cs +++ b/src/mscorlib/src/System/Threading/Tasks/future.cs @@ -65,7 +65,6 @@ namespace System.Threading.Tasks /// and may be used from multiple threads concurrently. /// /// - [HostProtection(Synchronization = true, ExternalThreading = true)] [DebuggerTypeProxy(typeof(SystemThreadingTasks_FutureDebugView<>))] [DebuggerDisplay("Id = {Id}, Status = {Status}, Method = {DebuggerDisplayMethodDescription}, Result = {DebuggerDisplayResultDescription}")] public class Task : Task diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs index 2022c0533c7c..8294c20c4deb 100644 --- a/src/mscorlib/src/System/Threading/Thread.cs +++ b/src/mscorlib/src/System/Threading/Thread.cs @@ -271,7 +271,6 @@ internal unsafe ThreadHandle GetNativeHandle() ** ** Exceptions: ThreadStateException if the thread has already been started. =========================================================================*/ - [HostProtection(Synchronization=true,ExternalThreading=true)] [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable public new void Start() { @@ -279,7 +278,6 @@ public new void Start() Start(ref stackMark); } - [HostProtection(Synchronization=true,ExternalThreading=true)] [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable public new void Start(object parameter) { @@ -395,7 +393,6 @@ public void Abort() [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern void AbortInternal(); - [HostProtection(Synchronization=true, ExternalThreading=true)] public bool Join(TimeSpan timeout) { long tm = (long)timeout.TotalMilliseconds; @@ -438,11 +435,9 @@ public static void Sleep(TimeSpan timeout) a explict busy loop because the hardware can be informed that it is busy waiting. */ [MethodImplAttribute(MethodImplOptions.InternalCall)] - [HostProtection(Synchronization=true,ExternalThreading=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern void SpinWaitInternal(int iterations); - [HostProtection(Synchronization=true,ExternalThreading=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] public static new void SpinWait(int iterations) { @@ -451,11 +446,9 @@ public static new void SpinWait(int iterations) [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] [SuppressUnmanagedCodeSecurity] - [HostProtection(Synchronization = true, ExternalThreading = true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool YieldInternal(); - [HostProtection(Synchronization = true, ExternalThreading = true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] public static new bool Yield() { @@ -529,14 +522,12 @@ public ApartmentState ApartmentState return (ApartmentState)GetApartmentStateNative(); } - [HostProtection(Synchronization=true, SelfAffectingThreading=true)] set { SetApartmentStateNative((int)value, true); } } - [HostProtection(Synchronization=true, SelfAffectingThreading=true)] public void SetApartmentState(ApartmentState state) { bool result = SetApartmentStateHelper(state, true); @@ -552,7 +543,6 @@ public void SetApartmentState(ApartmentState state) ** Allocates an un-named data slot. The slot is allocated on ALL the ** threads. =========================================================================*/ - [HostProtection(SharedState=true, ExternalThreading=true)] public static LocalDataStoreSlot AllocateDataSlot() { return LocalDataStoreManager.AllocateDataSlot(); @@ -563,7 +553,6 @@ public static LocalDataStoreSlot AllocateDataSlot() ** threads. Named data slots are "public" and can be manipulated by ** anyone. =========================================================================*/ - [HostProtection(SharedState=true, ExternalThreading=true)] public static LocalDataStoreSlot AllocateNamedDataSlot(String name) { return LocalDataStoreManager.AllocateNamedDataSlot(name); @@ -574,7 +563,6 @@ public static LocalDataStoreSlot AllocateNamedDataSlot(String name) ** allocated. Named data slots are "public" and can be manipulated by ** anyone. =========================================================================*/ - [HostProtection(SharedState=true, ExternalThreading=true)] public static LocalDataStoreSlot GetNamedDataSlot(String name) { return LocalDataStoreManager.GetNamedDataSlot(name); @@ -585,7 +573,6 @@ public static LocalDataStoreSlot GetNamedDataSlot(String name) ** threads. Named data slots are "public" and can be manipulated by ** anyone. =========================================================================*/ - [HostProtection(SharedState=true, ExternalThreading=true)] public static void FreeNamedDataSlot(String name) { LocalDataStoreManager.FreeNamedDataSlot(name); @@ -594,7 +581,6 @@ public static void FreeNamedDataSlot(String name) /*========================================================================= ** Retrieves the value from the specified slot on the current thread, for that thread's current domain. =========================================================================*/ - [HostProtection(SharedState=true, ExternalThreading=true)] public static Object GetData(LocalDataStoreSlot slot) { LocalDataStoreHolder dls = s_LocalDataStore; @@ -611,7 +597,6 @@ public static Object GetData(LocalDataStoreSlot slot) /*========================================================================= ** Sets the data in the specified slot on the currently running thread, for that thread's current domain. =========================================================================*/ - [HostProtection(SharedState=true, ExternalThreading=true)] public static void SetData(LocalDataStoreSlot slot, Object data) { LocalDataStoreHolder dls = s_LocalDataStore; @@ -682,7 +667,6 @@ public static void SetData(LocalDataStoreSlot slot, Object data) } } - [HostProtection(ExternalThreading=true)] set { if (value == null) { throw new ArgumentNullException(nameof(value)); @@ -900,7 +884,6 @@ public static int GetDomainID() get { return m_Name; } - [HostProtection(ExternalThreading=true)] set { lock(this) { if (m_Name != null) diff --git a/src/mscorlib/src/System/Threading/ThreadLocal.cs b/src/mscorlib/src/System/Threading/ThreadLocal.cs index 3495891a5066..2b996cb34dc1 100644 --- a/src/mscorlib/src/System/Threading/ThreadLocal.cs +++ b/src/mscorlib/src/System/Threading/ThreadLocal.cs @@ -35,7 +35,6 @@ namespace System.Threading /// [DebuggerTypeProxy(typeof(SystemThreading_ThreadLocalDebugView<>))] [DebuggerDisplay("IsValueCreated={IsValueCreated}, Value={ValueForDebugDisplay}, Count={ValuesCountForDebugDisplay}")] - [HostProtection(Synchronization = true, ExternalThreading = true)] public class ThreadLocal : IDisposable { diff --git a/src/mscorlib/src/System/Threading/ThreadPool.cs b/src/mscorlib/src/System/Threading/ThreadPool.cs index 3af006be2d19..451b15d22feb 100644 --- a/src/mscorlib/src/System/Threading/ThreadPool.cs +++ b/src/mscorlib/src/System/Threading/ThreadPool.cs @@ -1341,7 +1341,6 @@ static internal void PerformWaitOrTimerCallback(Object state, bool timedOut) NativeOverlapped* pOVERLAP // ptr to OVERLAP structure ); - [HostProtection(Synchronization=true, ExternalThreading=true)] public static class ThreadPool { diff --git a/src/mscorlib/src/System/Threading/Timer.cs b/src/mscorlib/src/System/Threading/Timer.cs index 02f7308d12c7..5bfefccad2b2 100644 --- a/src/mscorlib/src/System/Threading/Timer.cs +++ b/src/mscorlib/src/System/Threading/Timer.cs @@ -756,7 +756,6 @@ public bool Close(WaitHandle notifyObject) } - [HostProtection(Synchronization=true, ExternalThreading=true)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class Timer : MarshalByRefObject, IDisposable {