diff options
author | Stephen Toub <stoub@microsoft.com> | 2019-04-04 12:58:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-04 12:58:58 -0400 |
commit | 9909a7d4b5b8bd7d898be480a186d098dde5f0d7 (patch) | |
tree | a039d3bb5dcd778699ab23e56ec0185f8f7d3fb6 /src | |
parent | 34f7e6730e25bcfc034265a06f82d5487dbb17b6 (diff) | |
download | coreclr-9909a7d4b5b8bd7d898be480a186d098dde5f0d7.tar.gz coreclr-9909a7d4b5b8bd7d898be480a186d098dde5f0d7.tar.bz2 coreclr-9909a7d4b5b8bd7d898be480a186d098dde5f0d7.zip |
Fix build break due to conflicting PRs (#23726)
Diffstat (limited to 'src')
3 files changed, 9 insertions, 10 deletions
diff --git a/src/System.Private.CoreLib/shared/System/IO/FileStream.Unix.cs b/src/System.Private.CoreLib/shared/System/IO/FileStream.Unix.cs index 7e38f9b09a..62e1fdec25 100644 --- a/src/System.Private.CoreLib/shared/System/IO/FileStream.Unix.cs +++ b/src/System.Private.CoreLib/shared/System/IO/FileStream.Unix.cs @@ -291,7 +291,7 @@ namespace System.IO // override may already exist on a derived type. if (_useAsyncIO && _writePos > 0) { - return new ValueTask(Task.Factory.StartNew(s => ((FileStream)s).Dispose(), this, + return new ValueTask(Task.Factory.StartNew(s => ((FileStream)s!).Dispose(), this, // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761 CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default)); } @@ -365,7 +365,7 @@ namespace System.IO if (CanWrite) { return Task.Factory.StartNew( - state => ((FileStream)state).FlushOSBuffer(), + state => ((FileStream)state!).FlushOSBuffer(), // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761 this, cancellationToken, TaskCreationOptions.DenyChildAttach, @@ -569,7 +569,7 @@ namespace System.IO // whereas on Windows it may happen before the write has completed. Debug.Assert(t.Status == TaskStatus.RanToCompletion); - var thisRef = (FileStream)s; + var thisRef = (FileStream)s!; // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761 Debug.Assert(thisRef._asyncState != null); try { @@ -728,7 +728,7 @@ namespace System.IO // whereas on Windows it may happen before the write has completed. Debug.Assert(t.Status == TaskStatus.RanToCompletion); - var thisRef = (FileStream)s; + var thisRef = (FileStream)s!; // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761 Debug.Assert(thisRef._asyncState != null); try { diff --git a/src/System.Private.CoreLib/shared/System/IO/FileStream.Windows.cs b/src/System.Private.CoreLib/shared/System/IO/FileStream.Windows.cs index 6996a3b2ec..4de7a3b254 100644 --- a/src/System.Private.CoreLib/shared/System/IO/FileStream.Windows.cs +++ b/src/System.Private.CoreLib/shared/System/IO/FileStream.Windows.cs @@ -49,7 +49,7 @@ namespace System.IO private static readonly unsafe IOCompletionCallback s_ioCallback = FileStreamCompletionSource.IOCallback; - private Task? _activeBufferOperation = null; // tracks in-progress async ops using the buffer + private Task _activeBufferOperation = Task.CompletedTask; // tracks in-progress async ops using the buffer private PreAllocatedOverlapped? _preallocatedOverlapped; // optimization for async ops to avoid per-op allocations private FileStreamCompletionSource? _currentOverlappedOwner; // async op currently using the preallocated overlapped @@ -197,8 +197,7 @@ namespace System.IO return secAttrs; } - private bool HasActiveBufferOperation - => _activeBufferOperation != null && !_activeBufferOperation.IsCompleted; + private bool HasActiveBufferOperation => !_activeBufferOperation.IsCompleted; public override bool CanSeek => _canSeek; @@ -1589,7 +1588,7 @@ namespace System.IO if (CanWrite) { return Task.Factory.StartNew( - state => ((FileStream)state).FlushOSBuffer(), + state => ((FileStream)state!).FlushOSBuffer(), // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761 this, cancellationToken, TaskCreationOptions.DenyChildAttach, diff --git a/src/System.Private.CoreLib/shared/System/IO/Stream.cs b/src/System.Private.CoreLib/shared/System/IO/Stream.cs index 66a0094505..1f0943f2fc 100644 --- a/src/System.Private.CoreLib/shared/System/IO/Stream.cs +++ b/src/System.Private.CoreLib/shared/System/IO/Stream.cs @@ -256,7 +256,7 @@ namespace System.IO public virtual Task FlushAsync(CancellationToken cancellationToken) { - return Task.Factory.StartNew(state => ((Stream)state).Flush(), this, + return Task.Factory.StartNew(state => ((Stream)state!).Flush(), this, // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761 cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } @@ -512,7 +512,7 @@ namespace System.IO asyncWaiter.ContinueWith((t, state) => { Debug.Assert(t.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); - var rwt = (ReadWriteTask)state; + var rwt = (ReadWriteTask)state!; // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761 Debug.Assert(rwt._stream != null); rwt._stream.RunReadWriteTask(rwt); // RunReadWriteTask(readWriteTask); }, readWriteTask, default, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); |