MCPcopy Create free account
hub / github.com/coder/coder / Reset

Method Reset

agent/agentproc/headtail.go:315–326  ·  view source on GitHub ↗

Reset clears the buffer, discarding all data.

()

Source from the content-addressed store, hash-verified

313
314// Reset clears the buffer, discarding all data.
315func (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}

Callers 1

TestHeadTailBuffer_ResetFunction · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1

TestHeadTailBuffer_ResetFunction · 0.76