Some 4.0 API tweaks
authorMarek Safar <marek.safar@gmail.com>
Thu, 16 Dec 2010 09:25:06 +0000 (09:25 +0000)
committerMarek Safar <marek.safar@gmail.com>
Thu, 16 Dec 2010 09:25:47 +0000 (09:25 +0000)
mcs/class/corlib/System.Collections.Concurrent/ConcurrentQueue.cs
mcs/class/corlib/System.Collections.Concurrent/ConcurrentStack.cs
mcs/class/corlib/System.Threading/AsyncFlowControl.cs

index 1b2622410a70268c86bc49fe75f3370d3c6ff3c4..528ed194e66ad92f6b30fc05e9ab8133bd592df9 100644 (file)
@@ -33,8 +33,8 @@ using System.Runtime.Serialization;
 namespace System.Collections.Concurrent
 {
 
-       [System.Diagnostics.DebuggerDisplay ("Count = {Count}")]
-       [System.Diagnostics.DebuggerTypeProxy ("System.Collections.Concurrent.SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView`1")]
+       [System.Diagnostics.DebuggerDisplay ("Count={Count}")]
+       [System.Diagnostics.DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
        public class ConcurrentQueue<T> : IProducerConsumerCollection<T>, IEnumerable<T>, ICollection,
                                          IEnumerable
        {
index 7a2df80b6878df66779bcdaff1ee3942e2106562..920435b017b93e7211dc544592921167a8cd5db5 100644 (file)
@@ -34,7 +34,7 @@ namespace System.Collections.Concurrent
 {
        
        [System.Diagnostics.DebuggerDisplay ("Count = {Count}")]
-       [System.Diagnostics.DebuggerTypeProxy ("System.Collections.Concurrent.SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView`1")]
+       [System.Diagnostics.DebuggerTypeProxy (typeof (CollectionDebuggerView<>))]
        public class ConcurrentStack<T> : IProducerConsumerCollection<T>, IEnumerable<T>,
                                          ICollection, IEnumerable
        {
@@ -80,12 +80,12 @@ namespace System.Collections.Concurrent
                        PushRange (items, 0, items.Length);
                }
                
-               public void PushRange (T[] items, int start, int length)
+               public void PushRange (T[] items, int startIndex, int count)
                {
                        Node insert = null;
                        Node first = null;
                        
-                       for (int i = start; i < length; i++) {
+                       for (int i = startIndex; i < count; i++) {
                                Node temp = new Node ();
                                temp.Value = items[i];
                                temp.Next = insert;
@@ -99,7 +99,7 @@ namespace System.Collections.Concurrent
                                first.Next = head;
                        } while (Interlocked.CompareExchange (ref head, insert, first.Next) != first.Next);
                        
-                       Interlocked.Add (ref count, length);
+                       Interlocked.Add (ref count, count);
                }
                
                public bool TryPop (out T result)
index a534b7de23672f8a87d9545afedad2dc66bff4e4..cdd937359558445e68579e8fd05add6f9e17f5c9 100644 (file)
@@ -65,7 +65,11 @@ namespace System.Threading {
                        _t = null;
                }
 
-               void IDisposable.Dispose () 
+#if NET_4_0
+               public void Dispose ()
+#else
+               void IDisposable.Dispose ()
+#endif
                {
                        if (_t != null) {
                                Undo ();