MCPcopy
hub / github.com/SurgeDM/Surge / SetChunkState

Method SetChunkState

internal/engine/types/progress.go:385–389  ·  view source on GitHub ↗

SetChunkState sets the 2-bit state for a specific chunk index (thread-safe)

(index int, status ChunkStatus)

Source from the content-addressed store, hash-verified

383
384// SetChunkState sets the 2-bit state for a specific chunk index (thread-safe)
385func (ps *ProgressState) SetChunkState(index int, status ChunkStatus) {
386 ps.mu.Lock()
387 defer ps.mu.Unlock()
388 ps.setChunkState(index, status)
389}
390
391// setChunkState sets the 2-bit state (internal, expects lock)
392func (ps *ProgressState) setChunkState(index int, status ChunkStatus) {

Callers 1

makeDownloadWithChunksFunction · 0.80

Calls 1

setChunkStateMethod · 0.95

Tested by 1

makeDownloadWithChunksFunction · 0.64