MCPcopy
hub / github.com/tinygo-org/tinygo / Wait

Method Wait

src/sync/waitgroup.go:73–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71}
72
73func (wg *WaitGroup) Wait() {
74 for {
75 counter := wg.futex.Load()
76 if counter == 0 {
77 return // everything already finished
78 }
79
80 if wg.futex.Wait(counter) {
81 // Successfully woken by WakeAll (in wg.Add).
82 break
83 }
84 }
85}
86
87func (wg *WaitGroup) Go(f func()) {
88 wg.Add(1)

Callers 11

TestCorpusFunction · 0.95
TestTestFunction · 0.95
mainFunction · 0.95
generateFunction · 0.95
mainFunction · 0.95
TestRing512_SPSCFunction · 0.95
mainFunction · 0.95
TestCondBroadcastFunction · 0.95
TestWaitGroupUncontendedFunction · 0.95
TestWaitGroupFunction · 0.95

Calls 2

WaitMethod · 0.65
LoadMethod · 0.45

Tested by 7

TestCorpusFunction · 0.76
TestTestFunction · 0.76
TestRing512_SPSCFunction · 0.76
TestCondBroadcastFunction · 0.76
TestWaitGroupUncontendedFunction · 0.76
TestWaitGroupFunction · 0.76