Work on logging format

This commit is contained in:
Mathias Hall-Andersen
2018-02-04 19:18:44 +01:00
parent 283e7117cf
commit ceccd39420
7 changed files with 51 additions and 32 deletions

View File

@@ -11,6 +11,10 @@ func NewSignal() (s Signal) {
return
}
func (s *Signal) Close() {
close(s.C)
}
func (s *Signal) Disable() {
s.enabled.Set(false)
s.Clear()
@@ -43,7 +47,9 @@ func (s Signal) Clear() {
/* Unblocks all listeners (forever)
*/
func (s Signal) Broadcast() {
close(s.C)
if s.enabled.Get() {
close(s.C)
}
}
/* Wait for the signal