MCPcopy Create free account
hub / github.com/corestoreio/pkg / ShouldWait

Method ShouldWait

sync/suspend/state.go:143–165  ·  view source on GitHub ↗

ShouldWait checks atomically if the State has been set to run and if so the calling Goroutine waits until Done() has been called. You should use ShouldWait() as second case in your switch statement: switch { case hs.ShouldStart(scopeHash): // start here your process err := hs.Done(scope

(key uint64)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 4

ShouldWaitBytesMethod · 0.95
TestHashState_CanRunFunction · 0.95
TestHashState_ShouldWaitFunction · 0.95

Calls 2

InitializedMethod · 0.95
LockMethod · 0.80

Tested by 3

TestHashState_CanRunFunction · 0.76
TestHashState_ShouldWaitFunction · 0.76