From 06bcccd6ac713c26df3803868726203640753bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 19 Dec 2016 22:21:36 +0100 Subject: [PATCH] Revert #1. The idea is that every wait() produces exactly one callback unless cancelled. --- source/eventcore/drivers/timer.d | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/eventcore/drivers/timer.d b/source/eventcore/drivers/timer.d index be73d4c..49f3769 100644 --- a/source/eventcore/drivers/timer.d +++ b/source/eventcore/drivers/timer.d @@ -64,9 +64,7 @@ final class LoopTimeoutTimerDriver : EventDriverTimers { foreach (tm; m_firedTimers) { auto cb = tm.callback; - if (!tm.pending) { - tm.callback = null; - } + tm.callback = null; if (cb) cb(tm.id); } @@ -139,7 +137,7 @@ final class LoopTimeoutTimerDriver : EventDriverTimers { 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; }