a41f938cec
As we have seen, dependencies version can prevent the build. We should user lock versions on dependencies that we know work: * Packages are vendored * Add Godep support * Added addtional install step in readme * Fix travis build error
26 lignes
368 o
Go
26 lignes
368 o
Go
package missinggo
|
|
|
|
import "sync"
|
|
|
|
type SynchronizedEvent struct {
|
|
mu sync.Mutex
|
|
e Event
|
|
}
|
|
|
|
func (me *SynchronizedEvent) Set() {
|
|
me.mu.Lock()
|
|
me.e.Set()
|
|
me.mu.Unlock()
|
|
}
|
|
|
|
func (me *SynchronizedEvent) Clear() {
|
|
me.mu.Lock()
|
|
me.e.Clear()
|
|
me.mu.Unlock()
|
|
}
|
|
|
|
func (me *SynchronizedEvent) C() <-chan struct{} {
|
|
me.mu.Lock()
|
|
defer me.mu.Unlock()
|
|
return me.e.C()
|
|
}
|