1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-29 08:22:11 +02:00
imgproxy/mutex.go
2018-10-05 21:17:36 +06:00

16 lines
177 B
Go

package main
type mutex chan struct{}
func newMutex(size int) mutex {
return make(mutex, size)
}
func (m mutex) Lock() {
m <- struct{}{}
}
func (m mutex) Unock() {
<-m
}