MCPcopy Create free account
hub / github.com/sourcegraph/conc / WaitGroup

Struct WaitGroup

waitgroup.go:22–25  ·  view source on GitHub ↗

WaitGroup is the primary building block for scoped concurrency. Goroutines can be spawned in the WaitGroup with the Go method, and calling Wait() will ensure that each of those goroutines exits before continuing. Any panics in a child goroutine will be caught and propagated to the caller of Wait().

Source from the content-addressed store, hash-verified

20// The zero value of WaitGroup is usable, just like sync.WaitGroup.
21// Also like sync.WaitGroup, it must not be copied after first use.
22type WaitGroup struct {
23 wg sync.WaitGroup
24 pc panics.Catcher
25}
26
27// Go spawns a new goroutine in the WaitGroup.
28func (h *WaitGroup) Go(f func()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected