ThreadSafeHashSetTClear Method
Namespace: KGySoft.CollectionsAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public:
virtual void Clear() sealed
abstract Clear : unit -> unit
override Clear : unit -> unit
Implements
ICollectionTClear 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 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.