Work on logging format
This commit is contained in:
parent
283e7117cf
commit
ceccd39420
7 changed files with 51 additions and 32 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue