Patchwork [bitbake-devel] runqueue: Fix handling of zero priority task

login
register
mail settings
Submitter Richard Purdie
Date April 13, 2014, 10:44 a.m.
Message ID <1397385865.15843.45.camel@ted>
Download mbox | patch
Permalink /patch/70549/
State New
Headers show

Comments

Richard Purdie - April 13, 2014, 10:44 a.m.
The zero priority task should be run first but was being confused with
the None value the priority field defaulted to. Check for None
explicitly to avoid this error.

In the real world this doesn't change much but it confused the debug
output from the schedulers.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 6372b65..274ccf2 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -139,7 +139,7 @@  class RunQueueScheduler(object):
         bestprio = None
         for taskid in self.buildable:
             prio = self.rev_prio_map[taskid]
-            if not bestprio or bestprio > prio:
+            if bestprio is None or bestprio > prio:
                 stamp = self.stamps[taskid]
                 if stamp in self.rq.build_stamps.itervalues():
                     continue