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

Method trackProcess

agent/agentssh/agentssh.go:1169–1184  ·  view source on GitHub ↗

trackCommand registers the process with the server. If the server is closing, the process is not registered and should be closed. nolint:revive

(p *os.Process, add bool)

Source from the content-addressed store, hash-verified

1167//
1168//nolint:revive
1169func (s *Server) trackProcess(p *os.Process, add bool) (ok bool) {
1170 s.mu.Lock()
1171 defer s.mu.Unlock()
1172 if add {
1173 if s.closing != nil {
1174 // Server closed.
1175 return false
1176 }
1177 s.wg.Add(1)
1178 s.processes[p] = struct{}{}
1179 return true
1180 }
1181 s.wg.Done()
1182 delete(s.processes, p)
1183 return true
1184}
1185
1186// Close the server and all active connections. Server can be re-used
1187// after Close is done.

Callers 1

startNonPTYSessionMethod · 0.95

Calls 4

AddMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
DoneMethod · 0.45

Tested by

no test coverage detected