ConcurrentQueue
authorViktor Hofer <viktor.hofer@outlook.com>
Wed, 23 Aug 2017 14:54:39 +0000 (16:54 +0200)
committerViktor Hofer <viktor.hofer@outlook.com>
Thu, 7 Sep 2017 20:53:06 +0000 (22:53 +0200)
src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs

index fc2ce39..3e83f55 100644 (file)
@@ -5,7 +5,6 @@
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
 using System.Threading;
 
 namespace System.Collections.Concurrent
@@ -53,16 +52,11 @@ namespace System.Collections.Concurrent
         /// Lock used to protect cross-segment operations, including any updates to <see cref="_tail"/> or <see cref="_head"/>
         /// and any operations that need to get a consistent view of them.
         /// </summary>
-        [NonSerialized]
         private object _crossSegmentLock;
         /// <summary>The current tail segment.</summary>
-        [NonSerialized]
         private volatile Segment _tail;
         /// <summary>The current head segment.</summary>
-        [NonSerialized]
         private volatile Segment _head;
-        /// <summary>Field used to temporarily store the contents of the queue for serialization.</summary>
-        private T[] _serializationArray;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="ConcurrentQueue{T}"/> class.
@@ -73,29 +67,6 @@ namespace System.Collections.Concurrent
             _tail = _head = new Segment(InitialSegmentLength);
         }
 
-        /// <summary>Set the data array to be serialized.</summary>
-        [OnSerializing]
-        private void OnSerializing(StreamingContext context)
-        {
-            _serializationArray = ToArray();
-        }
-
-        /// <summary>Clear the data array that was serialized.</summary>
-        [OnSerialized]
-        private void OnSerialized(StreamingContext context)
-        {
-            _serializationArray = null;
-        }
-
-        /// <summary>Construct the queue from the deserialized <see cref="_serializationArray"/>.</summary>
-        [OnDeserialized]
-        private void OnDeserialized(StreamingContext context)
-        {
-            Debug.Assert(_serializationArray != null);
-            InitializeFromCollection(_serializationArray);
-            _serializationArray = null;
-        }
-
         /// <summary>
         /// Initializes the contents of the queue from an existing collection.
         /// </summary>