mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-29 08:22:11 +02:00
16 lines
177 B
Go
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
|
|
}
|