ThreadSafeHashSetTClear Method

Removes all items from the ThreadSafeHashSetT.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public void Clear()

Implements

ICollectionTClear

Remarks

If PreserveMergedItems is , or when the amount of removed items does not exceed a limit, then This method is an O(n) operation where n is the number of elements present in the inner lock-free storage. Otherwise, this method calls the Reset method, which frees up all the allocated entries.

  Note

Note that if PreserveMergedItems is , then though this method marks all items deleted in the ThreadSafeHashSetT, it never actually removes the items that are already merged into the faster lock-free storage. This ensures that re-adding a previously removed item will always be a fast, lock-free operation. To actually remove all items use the Reset method instead.

See Also