diff options
author | Viktor Hofer <viktor.hofer@outlook.com> | 2017-08-24 18:29:57 +0200 |
---|---|---|
committer | Viktor Hofer <viktor.hofer@outlook.com> | 2017-09-12 17:05:17 +0200 |
commit | 435f5420e7df4f2ef77c9beca6bdafa5fc976d30 (patch) | |
tree | 6782d92540d9a6e73c12b9ad46fd8050c6b7e110 /src | |
parent | 058b3ed152438e05ef795fcd7c97cb7ed389a7fb (diff) | |
download | coreclr-435f5420e7df4f2ef77c9beca6bdafa5fc976d30.tar.gz coreclr-435f5420e7df4f2ef77c9beca6bdafa5fc976d30.tar.bz2 coreclr-435f5420e7df4f2ef77c9beca6bdafa5fc976d30.zip |
IO
Diffstat (limited to 'src')
-rw-r--r-- | src/mscorlib/src/System/IO/MemoryStream.cs | 1 | ||||
-rw-r--r-- | src/mscorlib/src/System/IO/Stream.cs | 2 | ||||
-rw-r--r-- | src/mscorlib/src/System/IO/StreamReader.cs | 14 |
3 files changed, 5 insertions, 12 deletions
diff --git a/src/mscorlib/src/System/IO/MemoryStream.cs b/src/mscorlib/src/System/IO/MemoryStream.cs index d97d3f4c8f..2ac7c07db4 100644 --- a/src/mscorlib/src/System/IO/MemoryStream.cs +++ b/src/mscorlib/src/System/IO/MemoryStream.cs @@ -49,7 +49,6 @@ namespace System.IO private bool _exposable; // Whether the array can be returned to the user. private bool _isOpen; // Is this stream open or closed? - [NonSerialized] private Task<int> _lastReadTask; // The last successful task returned from ReadAsync private const int MemStreamMaxLength = Int32.MaxValue; diff --git a/src/mscorlib/src/System/IO/Stream.cs b/src/mscorlib/src/System/IO/Stream.cs index ae8ca517c4..82fad24c6d 100644 --- a/src/mscorlib/src/System/IO/Stream.cs +++ b/src/mscorlib/src/System/IO/Stream.cs @@ -41,9 +41,7 @@ namespace System.IO // To implement Async IO operations on streams that don't support async IO - [NonSerialized] private ReadWriteTask _activeReadWriteTask; - [NonSerialized] private SemaphoreSlim _asyncActiveSemaphore; internal SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized() diff --git a/src/mscorlib/src/System/IO/StreamReader.cs b/src/mscorlib/src/System/IO/StreamReader.cs index 1fc72bffd1..9ff9187663 100644 --- a/src/mscorlib/src/System/IO/StreamReader.cs +++ b/src/mscorlib/src/System/IO/StreamReader.cs @@ -58,7 +58,6 @@ namespace System.IO // This is used only for preamble detection private int bytePos; - [NonSerialized] private StringBuilder _builder; // This is the maximum number of chars we can get from one call to @@ -84,14 +83,12 @@ namespace System.IO private bool _isBlocked; // The intent of this field is to leave open the underlying stream when - // disposing of this StreamReader. A name like _leaveOpen is better, - // but this type is serializable, and this field's name was _closable. - private bool _closable; // Whether to close the underlying stream. + // disposing of this StreamReader. + private bool _leaveOpen; // Whether to keep the underlying stream open. // We don't guarantee thread safety on StreamReader, but we should at // least prevent users from trying to read anything while an Async // read from the same thread is in progress. - [NonSerialized] private volatile Task _asyncReadTask; private void CheckAsyncTaskInProgress() @@ -216,14 +213,14 @@ namespace System.IO _checkPreamble = (_preamble.Length > 0); _isBlocked = false; - _closable = !leaveOpen; + _leaveOpen = leaveOpen; } // Init used by NullStreamReader, to delay load encoding internal void Init(Stream stream) { this.stream = stream; - _closable = true; + _leaveOpen = false; } public override void Close() @@ -265,7 +262,7 @@ namespace System.IO } internal bool LeaveOpen { - get { return !_closable; } + get { return _leaveOpen; } } // DiscardBufferedData tells StreamReader to throw away its internal @@ -1145,7 +1142,6 @@ namespace System.IO } #endregion - // No data, class doesn't need to be serializable. // Note this class is threadsafe. private class NullStreamReader : StreamReader { |