Commit Graph
89 Commits
Author SHA1 Message Date
Rodrigo Kumpera 21f79f8d6e Merge pull request #1074 from esdrubal/bug18421
Changed TryPeek to handle race condition with Dequeue.
2014-06-19 11:45:17 -04:00
marcos henrich 4449269d8f Changed TryPeek to handle race condition with Dequeue.
Dequeue sets the head.Value to its default. When TryPeek is interrupted in the process of retrieving the value some times Dequeue sets the value to its default. TryPeek now checks the head has not been changed before returning the value.
2014-05-30 20:31:47 +01:00
Jérémie Laval 610d1e7aaf Merge pull request #1068 from esdrubal/bug18421
Changed ConcurrentQueue to remove last ref/value. Fixes 18421
2014-05-30 14:50:35 -04:00
marcos henrich db71dba1b7 Changed ConcurrentDictionary.Contains(KeyValuePair<TKey, TValue>) to also compare value. Fixes #16990. 2014-05-30 11:33:02 +01:00
marcos henrich 7c52a7bf5f Overwrites dequeued ref/value with default. Fixes 18421.
ConcurrentQueue was keeping the last dequeued ref/value.
2014-05-29 17:53:32 +01:00
Craig Minihan c3a89bffeb [Fix] Bugzilla #18182 - ConcurrentQueue<T>.TryPeek() is not thread safe
- removed IsEmpty test from TryPeek() since not needed now
2014-03-15 14:05:01 -07:00
Craig Minihan 704456aa48 [Fix] Bugzilla #18182 - ConcurrentQueue<T>.TryPeek() is not thread safe
- in the previous version the IsEmpty could be false, but by time we get
  to head.Next.Value we get an exception since Value is now null
- passes existing test cases, although these are not definitive since
  they don't show threading issue
- would need to adapt System.Threading.Tasks.ParallelTestHelper to allow
  TryPeek() to be called during Enqueue/Dequeue operations to truly
  test this change out
2014-03-15 13:50:51 -07:00
Craig Minihan 7bc35e0a01 Correctly set Count after call to ConcurrentStack.PushRange() 2014-03-05 04:33:54 -08:00
Simon Hartmann 11b5312c83 Bug 17838 - IDictionary item property implemention for ConcurrentDictionary/SortedList_T throws exception on non-existing key
Avoid double lookup for Dictionary IDictionary.get_Item property impl
2014-02-19 16:40:57 +01:00
Marek Safar 9c787bbc85 [corlib] Add more argument checks to ConcurrentStack 2014-02-05 14:09:11 +01:00
Marek Safar e586b796b1 [corlib] Mark ConcurrentDictionary serializable. Fixes #16730 2013-12-12 11:32:36 +01:00
Martin Baulig 77df2f0865 Misc .NET 4.5 / PCL APIs. 2013-03-12 17:22:58 -04:00
Rodrigo Kumpera 1b92a4148c Since MOBILE implies NET_4_* now, take this into account and simplify our ifdefs. 2013-02-11 18:42:18 -05:00
Jeremie Laval 3e19969b80 [corlib] Fix a edge case of ConcurrentQueue dequeuing by retrying after we fix up things 2012-09-25 14:26:32 +01:00
Jeremie Laval 2bb98035f2 [corlib] Remove usage of ObjectPool, we will depend on sgen being a better GC instead 2012-09-25 14:26:31 +01:00
Petr Onderka e8c29f0f16 Check key for null in ConcurrentDictionary 2012-08-20 00:03:31 +02:00
Jeremie Laval f7549a7295 [corlib] Slightly better ToArray/CopyTo methods for ConcurrentStack / ConcurrentQueue 2012-07-26 17:34:23 +01:00
Jeremie Laval 62930a669c [corlib] Fix ConcurrentStack TryPopRange to update count atomically 2012-07-26 17:01:39 +01:00
Jeremie Laval 37c812036b [corlib] Fix ObjectPool to not incorrectly assume it was succeeding when its trial period ran out
Reported by Greg Young
2012-07-25 12:42:14 +01:00
Jeremie Laval 2ac4d350e2 [corlib] Add missing barrier to ObjectPool and comment the code 2012-07-25 12:36:03 +01:00
Jeremie Laval 40a84cbe25 [corlib] Fix ConcurrentStack.TryPopRange and add tests. Fix #5304 2012-05-24 19:05:57 +01:00
Jeremie Laval b082c17865 Fix #3639
The search code was taking care of hash collision for different objects inside the collection but it didn't handle properly the case where the supplied search key has the same hash than a different object inside the collection.
2012-03-01 13:05:33 +01:00
Jérémie Laval f84fddb7ce Fix ListPop 2011-10-15 19:26:37 +02:00
Jérémie Laval c6f371fe4f Add a pop front operation to ConcurrentOrderedList 2011-10-15 15:34:54 +02:00
Jérémie Laval b2fb65cde6 Fix double adding in ConcurrentDictionary ctor with IEnumerable seed. 2011-09-25 11:23:43 +02:00
Jérémie Laval 9869f11cb4 Return a new object in ObjectPool when too much time is spent spinning in Take 2011-02-17 11:33:30 +00:00
Jérémie Laval 766db2eadf Fix test failure in SplitOrderedList 2011-02-15 13:36:27 +00:00
Jérémie Laval 325580a101 Correctly add ObjectPool to the build 2011-02-14 18:16:51 +00:00
Jérémie Laval 5dbf63ae30 Use ObjectPool in SplitOrderedList 2011-02-14 18:12:42 +00:00
Jérémie Laval d25f6ac751 Fix wrong CAS check in SplitOrderedList 2011-02-14 18:12:42 +00:00
Jérémie Laval 7b07f2b024 Use ObjectPool in ConcurrentStack 2011-02-14 18:12:41 +00:00
Jérémie Laval 8390e2da1e Use ObjectPool in ConcurrentQueue 2011-02-14 18:12:41 +00:00
Jérémie Laval 62b6eb2540 Add concurrent implementation of an ObjectPool to reuse small objects like Node instances 2011-02-14 18:12:41 +00:00
Geoff Norton 83e999b7d7 Add pfx to the mobile profile 2011-01-25 01:51:17 -05:00
Jérémie Laval f9aec637ac Make ConcurrentSkipList implements IEnumerable and ICollection instead of IProducerConsummerCollection 2011-01-13 15:38:42 +00:00
Jérémie Laval 4f58465978 Make ConcurrentOrderedList implements IEnumerable and ICollection 2011-01-13 15:38:41 +00:00
Jérémie Laval 579665f7ba Rename namespaces and update docs 2011-01-13 15:38:41 +00:00
Jérémie Laval 58b0cad7f5 Add Comparer property to ConcurrentOrderedList 2011-01-13 15:38:41 +00:00
Jérémie Laval a1d84d7a67 First drop of a new Mono.Parallel assembly 2011-01-13 15:38:40 +00:00
Jérémie Laval 011503ddaf Remove now unused internal classes 2011-01-07 13:50:32 +00:00
Jérémie Laval b712c20362 Fix comments 2011-01-06 14:42:26 +00:00
Jérémie Laval 10f99bac05 Protect SpinLock's Enter method against asynchronous exception 2011-01-06 14:37:49 +00:00
Jérémie Laval 1e9443a9b6 Use correct exception when a key is not found in ConcurrentDictionary 2011-01-04 17:37:49 +00:00
Marek Safar d84d7c7eb9 Remove no longer used BOOTSTRAP conditionals 2010-12-29 12:41:12 +00:00
Jérémie Laval 82264df085 Remove a leftover debugging scwl 2010-12-17 16:09:37 +00:00
Jérémie Laval 09185b9e81 Add support for storing elements with the same hashcode in ConcurrentDictionary. Add corresponding unit test. 2010-12-16 13:39:32 +00:00
Marek Safar 6954973148 Some 4.0 API tweaks 2010-12-16 09:25:47 +00:00
Jérémie Laval 89fecf7d97 Yet more parameter manual fixup 2010-12-15 17:09:19 +00:00
Marek Safar bd05c6c836 Some .net 4.0 api compatibility fixes 2010-12-15 11:12:07 +00:00
Jérémie Laval 28bea32383 Improve fallback SpinWait to include the initial logic of SpinWait 2010-11-22 18:05:20 +00:00