MCPcopy Create free account
hub / github.com/gogs/gogs / Add

Function Add

internal/process/manager.go:44–56  ·  view source on GitHub ↗

Add adds a process to global list and returns its PID.

(desc string, cmd *exec.Cmd)

Source from the content-addressed store, hash-verified

42
43// Add adds a process to global list and returns its PID.
44func Add(desc string, cmd *exec.Cmd) int64 {
45 counter.Lock()
46 defer counter.Unlock()
47
48 pid := counter.PID()
49 Processes = append(Processes, &Process{
50 PID: pid,
51 Description: desc,
52 Start: time.Now(),
53 Cmd: cmd,
54 })
55 return pid
56}
57
58// Remove removes a process from global list.
59// It returns true if the process is found and removed by given pid.

Callers 2

GetDiffPreviewMethod · 0.92
ExecDirEnvFunction · 0.85

Calls 2

appendFunction · 0.85
PIDMethod · 0.80

Tested by

no test coverage detected