Reset clears the buffer, discarding all data.
()
| 313 | |
| 314 | // Reset clears the buffer, discarding all data. |
| 315 | func (b *HeadTailBuffer) Reset() { |
| 316 | b.mu.Lock() |
| 317 | defer b.mu.Unlock() |
| 318 | b.head = nil |
| 319 | b.tail = nil |
| 320 | b.tailPos = 0 |
| 321 | b.tailFull = false |
| 322 | b.headFull = false |
| 323 | b.closed = false |
| 324 | b.totalBytes = 0 |
| 325 | b.cond.Broadcast() |
| 326 | } |