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

@@ -12,8 +12,7 @@ type Timer struct {
/* Starts the timer if not already pending
*/
func (t *Timer) Start(dur time.Duration) bool {
set := t.pending.Swap(true)
if !set {
if !t.pending.Swap(true) {
t.timer.Reset(dur)
return true
}
@@ -23,8 +22,7 @@ func (t *Timer) Start(dur time.Duration) bool {
/* Stops the timer
*/
func (t *Timer) Stop() {
set := t.pending.Swap(true)
if set {
if t.pending.Swap(true) {
t.timer.Stop()
select {
case <-t.timer.C: