Documentation ¶
Overview ¶
Package sync extends basic synchronization primitives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WaitGroup ¶
type WaitGroup struct {
// contains filtered or unexported fields
}
A WaitGroup waits for a collection of goroutines to finish. The main goroutine calls Add to set the number of goroutines to wait for. Then each of the goroutines runs and calls Done when finished. At the same time, Wait can be used to block until all goroutines have finished.
WaitGroups in the sync package do not allow adding or subtracting from the counter while another goroutine is waiting, while this one does.
A WaitGroup must not be copied after first use.
In the terminology of the Go memory model, a call to Done
Click to show internal directories.
Click to hide internal directories.