File tree 1 file changed +5
-4
lines changed 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ func (a *alarmer) set(ns int64) {
47
47
}
48
48
a .wakeMeAt = make (chan int64 , 10 )
49
49
go wakeLoop (a .wakeMeAt , a .wakeUp )
50
+ a .wakeTime = ns
50
51
a .wakeMeAt <- ns
51
52
}
52
53
}
@@ -117,7 +118,7 @@ func tickerLoop() {
117
118
}
118
119
continue
119
120
}
120
- if tickers .nextTick <= now {
121
+ if t .nextTick <= now {
121
122
if len (t .c ) == 0 {
122
123
// Only send if there's room. We must not block.
123
124
// The channel is allocated with a one-element
@@ -130,9 +131,9 @@ func tickerLoop() {
130
131
// Still behind; advance in one big step.
131
132
t .nextTick += (now - t .nextTick + t .ns ) / t .ns * t .ns
132
133
}
133
- if t . nextTick > now && t . nextTick < wakeTime {
134
- wakeTime = t .nextTick
135
- }
134
+ }
135
+ if t .nextTick < wakeTime {
136
+ wakeTime = t . nextTick
136
137
}
137
138
prev = t
138
139
}
You can’t perform that action at this time.
0 commit comments