diff options
author | James Ko <jamesqko@gmail.com> | 2016-04-22 23:10:46 -0400 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-04-22 20:10:46 -0700 |
commit | 25c0a14c4db495ab452186f5b93b891977d71294 (patch) | |
tree | 93afb6c7fb686dcd0bf61eb7b9483f59e39cca3e | |
parent | 884757e6ae8fdbd259965670aa1f3324a148c3e9 (diff) | |
download | coreclr-25c0a14c4db495ab452186f5b93b891977d71294.tar.gz coreclr-25c0a14c4db495ab452186f5b93b891977d71294.tar.bz2 coreclr-25c0a14c4db495ab452186f5b93b891977d71294.zip |
Remove NEW_EXPERIMENTAL_ASYNC_IO define from mscorlib (#4530)
-rw-r--r-- | src/mscorlib/mscorlib.csproj | 2 | ||||
-rw-r--r-- | src/mscorlib/src/System/IO/Stream.cs | 25 |
2 files changed, 2 insertions, 25 deletions
diff --git a/src/mscorlib/mscorlib.csproj b/src/mscorlib/mscorlib.csproj index fa471c1e98..5a6f369eb9 100644 --- a/src/mscorlib/mscorlib.csproj +++ b/src/mscorlib/mscorlib.csproj @@ -40,7 +40,7 @@ <SignAssembly>true</SignAssembly> <DelaySign>true</DelaySign> - <DefineConstants>$(DefineConstants);NEW_EXPERIMENTAL_ASYNC_IO;_USE_NLS_PLUS_TABLE;RESOURCE_SATELLITE_CONFIG;INSIDE_CLR;CODE_ANALYSIS_BASELINE</DefineConstants> + <DefineConstants>$(DefineConstants);_USE_NLS_PLUS_TABLE;RESOURCE_SATELLITE_CONFIG;INSIDE_CLR;CODE_ANALYSIS_BASELINE</DefineConstants> </PropertyGroup> <!-- Add Serviceable attribute to the project's metadata --> diff --git a/src/mscorlib/src/System/IO/Stream.cs b/src/mscorlib/src/System/IO/Stream.cs index aadbf7a2d4..5a343fb321 100644 --- a/src/mscorlib/src/System/IO/Stream.cs +++ b/src/mscorlib/src/System/IO/Stream.cs @@ -20,9 +20,7 @@ using System.Threading.Tasks; using System.Runtime; using System.Runtime.InteropServices; -#if NEW_EXPERIMENTAL_ASYNC_IO using System.Runtime.CompilerServices; -#endif using System.Runtime.ExceptionServices; using System.Security; using System.Security.Permissions; @@ -48,7 +46,6 @@ namespace System.IO { // improvement in Copy performance. private const int _DefaultCopyBufferSize = 81920; -#if NEW_EXPERIMENTAL_ASYNC_IO // To implement Async IO operations on streams that don't support async IO [NonSerialized] @@ -62,7 +59,6 @@ namespace System.IO { // WaitHandle, we don't need to worry about Disposing it. return LazyInitializer.EnsureInitialized(ref _asyncActiveSemaphore, () => new SemaphoreSlim(1, 1)); } -#endif public abstract bool CanRead { [Pure] @@ -253,9 +249,6 @@ namespace System.IO { Contract.Ensures(Contract.Result<IAsyncResult>() != null); if (!CanRead) __Error.ReadNotSupported(); -#if !NEW_EXPERIMENTAL_ASYNC_IO - return BlockingBeginRead(buffer, offset, count, callback, state); -#else // To avoid a race with a stream's position pointer & generating race conditions // with internal buffer indexes in our own streams that // don't natively support async IO operations when there are multiple @@ -309,7 +302,6 @@ namespace System.IO { return asyncResult; // return it -#endif } public virtual int EndRead(IAsyncResult asyncResult) @@ -319,9 +311,6 @@ namespace System.IO { Contract.Ensures(Contract.Result<int>() >= 0); Contract.EndContractBlock(); -#if !NEW_EXPERIMENTAL_ASYNC_IO - return BlockingEndRead(asyncResult); -#else var readTask = _activeReadWriteTask; if (readTask == null) @@ -345,7 +334,6 @@ namespace System.IO { { FinishTrackingAsyncOperation(); } -#endif } [HostProtection(ExternalThreading = true)] @@ -409,9 +397,7 @@ namespace System.IO { { Contract.Ensures(Contract.Result<IAsyncResult>() != null); if (!CanWrite) __Error.WriteNotSupported(); -#if !NEW_EXPERIMENTAL_ASYNC_IO - return BlockingBeginWrite(buffer, offset, count, callback, state); -#else + // To avoid a race condition with a stream's position pointer & generating conditions // with internal buffer indexes in our own streams that // don't natively support async IO operations when there are multiple @@ -465,10 +451,8 @@ namespace System.IO { RunReadWriteTask(asyncResult); return asyncResult; // return it -#endif } -#if NEW_EXPERIMENTAL_ASYNC_IO private void RunReadWriteTaskWhenReady(Task asyncWaiter, ReadWriteTask readWriteTask) { Contract.Assert(readWriteTask != null); // Should be Contract.Requires, but CCRewrite is doing a poor job with @@ -511,7 +495,6 @@ namespace System.IO { Contract.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here."); _asyncActiveSemaphore.Release(); } -#endif public virtual void EndWrite(IAsyncResult asyncResult) { @@ -519,9 +502,6 @@ namespace System.IO { throw new ArgumentNullException("asyncResult"); Contract.EndContractBlock(); -#if !NEW_EXPERIMENTAL_ASYNC_IO - BlockingEndWrite(asyncResult); -#else var writeTask = _activeReadWriteTask; if (writeTask == null) { @@ -545,10 +525,8 @@ namespace System.IO { { FinishTrackingAsyncOperation(); } -#endif } -#if NEW_EXPERIMENTAL_ASYNC_IO // Task used by BeginRead / BeginWrite to do Read / Write asynchronously. // A single instance of this task serves four purposes: // 1. The work item scheduled to run the Read / Write operation @@ -658,7 +636,6 @@ namespace System.IO { bool ITaskCompletionAction.InvokeMayRunArbitraryCode { get { return true; } } } -#endif [HostProtection(ExternalThreading = true)] [ComVisible(false)] |