Files
kopia/object/semaphore.go
2017-10-14 16:38:22 -07:00

13 lines
145 B
Go

package object
type empty struct{}
type semaphore chan empty
func (s semaphore) Lock() {
s <- empty{}
}
func (s semaphore) Unlock() {
<-s
}