MCPcopy
hub / github.com/NVIDIA/aistore / setInProgressTo

Method setInProgressTo

dsort/manager.go:597–604  ·  view source on GitHub ↗

setInProgressTo updates in progress state. If inProgress is set to false and sort was aborted this means someone is waiting. Therefore the function is waking up everyone who is waiting. PRECONDITION: `m.mu` must be locked.

(inProgress bool)

Source from the content-addressed store, hash-verified

595//
596// PRECONDITION: `m.mu` must be locked.
597func (m *Manager) setInProgressTo(inProgress bool) {
598 // If marking as finished and job was aborted to need to free everyone
599 // who is waiting.
600 m.state.inProgress.Store(inProgress)
601 if !inProgress && m.aborted() {
602 m.state.wg.Done()
603 }
604}
605
606// setAbortedTo updates aborted state. If aborted is set to true and sort is not
607// yet finished. We need to inform current phase about abort (closing channel)

Callers 5

startMethod · 0.95
initMethod · 0.95
beforeTeardownMethod · 0.80
dsort_test.goFile · 0.80

Calls 3

abortedMethod · 0.95
DoneMethod · 0.65
StoreMethod · 0.45

Tested by 1

beforeTeardownMethod · 0.64