Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BitFaster.Caching/Buffers/MpscBoundedBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ private static int Length(Span<T> output)
/// <summary>
/// Removes all values from the buffer.
/// </summary>
/// <remarks>
/// Clear must be called from the single consumer thread.
/// </remarks>
public void Clear()
{
while (TryTake(out _) != BufferStatus.Empty)
Expand Down
2 changes: 1 addition & 1 deletion BitFaster.Caching/Buffers/StripedMpscBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public BufferStatus TryAdd(T item)
/// Removes all values from the buffer.
/// </summary>
/// <remarks>
/// Not thread safe.
/// Clear must be called from the single consumer thread.
/// </remarks>
public void Clear()
{
Expand Down
5 changes: 2 additions & 3 deletions BitFaster.Caching/Lfu/ConcurrentLfuCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,10 @@ public void Clear()
{
this.Trim(this.Count);

this.readBuffer.Clear();
this.writeBuffer.Clear();

lock (maintenanceLock)
{
this.readBuffer.Clear();
this.writeBuffer.Clear();
this.cmSketch.Clear();
}
}
Expand Down