From 7feab5951897f82a47d807720150b3e006ce0ca1 Mon Sep 17 00:00:00 2001 From: willy tarreau Date: Sat, 22 Apr 2006 15:13:16 +0200 Subject: [PATCH] [MINOR] always process the run queue from the head. This ensures that any task wan wake any other task up and that it will be processed too. --- haproxy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/haproxy.c b/haproxy.c index 1eb714e70..696b80dc7 100644 --- a/haproxy.c +++ b/haproxy.c @@ -5616,13 +5616,13 @@ int process_runnable_tasks() { } /* process each task in the run queue now. Each task may be deleted - * since we only use tnext. + * since we only use the run queue's head. Note that any task can be + * woken up by any other task and it will be processed immediately + * after as it will be queued on the run queue's head. */ - tnext = rq; - while ((t = tnext) != NULL) { + while ((t = rq) != NULL) { int temp_time; - - tnext = t->rqnext; + task_sleep(&rq, t); temp_time = t->process(t); next_time = MINTIME(temp_time, next_time);