(runID uuid.UUID)
| 111 | ) |
| 112 | |
| 113 | func 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 |
no test coverage detected