[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.
This commit is contained in:
willy tarreau 2006-04-22 15:13:16 +02:00
parent 898db9d595
commit 7feab59518
1 changed files with 5 additions and 5 deletions

View File

@ -5616,13 +5616,13 @@ int process_runnable_tasks() {
} }
/* process each task in the run queue now. Each task may be deleted /* 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 = rq) != NULL) {
while ((t = tnext) != NULL) {
int temp_time; int temp_time;
tnext = t->rqnext;
task_sleep(&rq, t); task_sleep(&rq, t);
temp_time = t->process(t); temp_time = t->process(t);
next_time = MINTIME(temp_time, next_time); next_time = MINTIME(temp_time, next_time);