Home | History | Annotate | Download | only in sync

Lines Matching refs:Add

14 // The main goroutine calls Add to set the number of
39 // Add adds delta, which may be negative, to the WaitGroup counter.
41 // If the counter goes negative, Add panics.
47 // Typically this means the calls to Add should execute before the statement
50 // new Add calls must happen after all previous Wait calls have returned.
52 func (wg *WaitGroup) Add(delta int) {
78 panic("sync: WaitGroup misuse: Add called concurrently with Wait")
89 panic("sync: WaitGroup misuse: Add called concurrently with Wait")
100 wg.Add(-1)
125 // Wait must be synchronized with the first Add.
126 // Need to model this is as a write to race with the read in Add.