[OPTIM] task: don't scan the run queue if we know it's empty

It happens quite often in fact, so let's save those precious cycles.
This commit is contained in:
Willy Tarreau 2011-09-10 20:08:49 +02:00
parent 576132e533
commit 98c6121ee5

View File

@ -196,6 +196,10 @@ void process_runnable_tasks(int *next)
run_queue_cur = run_queue; /* keep a copy for reporting */
nb_tasks_cur = nb_tasks;
max_processed = run_queue;
if (!run_queue)
return;
if (max_processed > 200)
max_processed = 200;