projects
/
arvados.git
/ blob
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge branch '17464-download-activity' refs #17464
[arvados.git]
/
sdk
/
go
/
arvados
/
throttle.go
1
package arvados
2
3
type throttle struct {
4
c chan struct{}
5
}
6
7
func newThrottle(n int) *throttle {
8
return &throttle{c: make(chan struct{}, n)}
9
}
10
11
func (t *throttle) Acquire() {
12
t.c <- struct{}{}
13
}
14
15
func (t *throttle) Release() {
16
<-t.c
17
}