-
Dmitriy Vyukov authored
It turns out there is a relatively common pattern that relies on inverted channel semaphore: gate := make(chan bool, N) for ... { // limit concurrency gate <- true go func() { foo(...) <-gate }() } // join all goroutines for i := 0; i < N; i++ { gate <- true } So handle synchronization on inverted semaphores with cap>1. Fixes #7718. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/84880046
9e1cadad
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
testdata | ||
README | ||
doc.go | ||
output_test.go | ||
race.go | ||
race_darwin_amd64.syso | ||
race_linux_amd64.syso | ||
race_test.go | ||
race_windows_amd64.syso |