1 Star 1 Fork 0

arlin / leaflet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
semaphore.go 201 Bytes
一键复制 编辑 原始数据 按行查看 历史
arlin 提交于 2020-01-09 21:10 . init
package util
type Semaphore chan struct{}
func MakeSemaphore(n int) Semaphore {
return make(Semaphore, n)
}
func (s Semaphore) Acquire() {
s <- struct{}{}
}
func (s Semaphore) Release() {
<-s
}
1
https://gitee.com/aarlin/leaflet.git
git@gitee.com:aarlin/leaflet.git
aarlin
leaflet
leaflet
v1.0.0

搜索帮助

53164aa7 5694891 3bd8fe86 5694891