File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ private static int Length(Span<T> output)
254254 /// <summary>
255255 /// Removes all values from the buffer.
256256 /// </summary>
257+ /// <remarks>
258+ /// Clear must be called from the single consumer thread.
259+ /// </remarks>
257260 public void Clear ( )
258261 {
259262 while ( TryTake ( out _ ) != BufferStatus . Empty )
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public BufferStatus TryAdd(T item)
123123 /// Removes all values from the buffer.
124124 /// </summary>
125125 /// <remarks>
126- /// Not thread safe .
126+ /// Clear must be called from the single consumer thread .
127127 /// </remarks>
128128 public void Clear ( )
129129 {
Original file line number Diff line number Diff line change @@ -137,11 +137,10 @@ public void Clear()
137137 {
138138 this . Trim ( this . Count ) ;
139139
140- this . readBuffer . Clear ( ) ;
141- this . writeBuffer . Clear ( ) ;
142-
143140 lock ( maintenanceLock )
144141 {
142+ this . readBuffer . Clear ( ) ;
143+ this . writeBuffer . Clear ( ) ;
145144 this . cmSketch . Clear ( ) ;
146145 }
147146 }
You can’t perform that action at this time.
0 commit comments