1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
7 func semaphore(max int) (acquire, release func()) {
9 ch := make(chan bool, max)
10 return func() { ch <- true }, func() { <-ch }
12 return func() {}, func() {}