Under what circumstances does ConcurrentDictionary.TryRemove () return false?
I was looking for a way to remove an item from a parallel dictionary. For some reason, there is no method Remove
, but there is a method TryRemove
that returns a bool
. On MSDN, he said he false
returns in case the process "failed", but does not say how.
- Is it false when the element is only missing?
- Is it false if the item cannot be removed due to a lock?
+3
source to share