MCPcopy Index your code
hub / github.com/coder/coder / trackRunRef

Function trackRunRef

coderd/x/chatd/chatdebug/recorder.go:113–122  ·  view source on GitHub ↗
(runID uuid.UUID)

Source from the content-addressed store, hash-verified

111)
112
113func trackRunRef(runID uuid.UUID) {
114 refCountMu.Lock()
115 defer refCountMu.Unlock()
116 val, _ := runRefCounts.LoadOrStore(runID, &atomic.Int32{})
117 counter, ok := val.(*atomic.Int32)
118 if !ok {
119 panic("chatdebug: runRefCounts contains non-*atomic.Int32 value")
120 }
121 counter.Add(1)
122}
123
124// releaseRunRef decrements the reference count for runID and cleans up
125// shared state when the last reference is released. The mutex ensures

Callers 1

ContextWithRunFunction · 0.85

Calls 4

LoadOrStoreMethod · 0.80
AddMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected