[BUG] fix buggy timeout computation in wake_expired_tasks
Wake_expired_tasks is supposed to return a date, not an interval. It
was causing busy loops in pollers.
diff --git a/src/task.c b/src/task.c
index 41c0b2a..8d9d10c 100644
--- a/src/task.c
+++ b/src/task.c
@@ -96,7 +96,7 @@
if (likely(timer_wq.data != NULL)) {
task = LIST_ELEM(timer_wq.data, struct task *, qlist);
if (likely(tv_isgt(&task->expire, &now))) {
- tv_remain(&now, &task->expire, next);
+ *next = task->expire;
return;
}
}
@@ -108,7 +108,7 @@
task = LIST_ELEM(data, struct task *, qlist);
if (tv_isgt(&task->expire, &now)) {
- tv_remain(&now, &task->expire, next);
+ *next = task->expire;
break;
}