Revert #1.
The idea is that every wait() produces exactly one callback unless cancelled.
This commit is contained in:
parent
e33d36eb46
commit
06bcccd6ac
|
@ -64,9 +64,7 @@ final class LoopTimeoutTimerDriver : EventDriverTimers {
|
||||||
|
|
||||||
foreach (tm; m_firedTimers) {
|
foreach (tm; m_firedTimers) {
|
||||||
auto cb = tm.callback;
|
auto cb = tm.callback;
|
||||||
if (!tm.pending) {
|
tm.callback = null;
|
||||||
tm.callback = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cb) cb(tm.id);
|
if (cb) cb(tm.id);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +137,7 @@ final class LoopTimeoutTimerDriver : EventDriverTimers {
|
||||||
|
|
||||||
final override void wait(TimerID timer, TimerCallback callback)
|
final override void wait(TimerID timer, TimerCallback callback)
|
||||||
{
|
{
|
||||||
assert(!m_timers[timer].callback);
|
assert(!m_timers[timer].callback, "Calling wait() no a timer that is already waiting.");
|
||||||
m_timers[timer].callback = callback;
|
m_timers[timer].callback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue