From fbfc053e34173651e35daa7a605a0a187c4d9609 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 14 May 2007 02:03:47 +0200 Subject: [PATCH] [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. --- src/task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/task.c b/src/task.c index 41c0b2a2b..8d9d10cd0 100644 --- a/src/task.c +++ b/src/task.c @@ -96,7 +96,7 @@ void wake_expired_tasks(struct timeval *next) 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 @@ void wake_expired_tasks(struct timeval *next) task = LIST_ELEM(data, struct task *, qlist); if (tv_isgt(&task->expire, &now)) { - tv_remain(&now, &task->expire, next); + *next = task->expire; break; }