When will ConcurrentDictionary TryRemove return false

后端 未结 3 1666
情深已故
情深已故 2020-12-29 00:57

Will it only return false if the dictionary does not contain a value for the given key or will it also return false due to thread race conditions, like another thread adds/u

3条回答
  •  Happy的楠姐
    2020-12-29 01:21

    The ConcurrentDictionary does not suffer from race conditions. That's why you use it.

    Return Value

    true if an object was removed successfully; otherwise, false.

提交回复
热议问题