MCPcopy
hub / github.com/lmorg/murex / HasTerminated

Method HasTerminated

lang/process_structs.go:159–164  ·  view source on GitHub ↗

HasTerminated checks if process has terminated. This is a function because terminated state can be subject to race conditions so we need a mutex to make the state thread safe.

()

Source from the content-addressed store, hash-verified

157// This is a function because terminated state can be subject to race conditions
158// so we need a mutex to make the state thread safe.
159func (p *Process) HasTerminated() (state bool) {
160 p.hasTerminatedM.Lock()
161 state = p.hasTerminatedV
162 p.hasTerminatedM.Unlock()
163 return
164}
165
166// HasCancelled is a wrapper function around context because it's a pretty ugly API
167func (p *Process) HasCancelled() bool {

Callers 6

DumpMethod · 0.95
GarbageCollectMethod · 0.80
_hasTerminatedMethod · 0.80
executeProcessFunction · 0.80
cmdWhileFunction · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1