summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@gmail.com>2018-08-13 23:04:44 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 21:45:58 +0100
commit331463011f98401092317ac4bf4cff90157718cf (patch)
tree22a05569bb7d76d3455f3d6518a59647878844fa /bitbake/lib/bb/runqueue.py
parentf7e24cc377b00f2341cd3168bbd0201828547255 (diff)
downloadpoky-331463011f98401092317ac4bf4cff90157718cf.tar.gz
bitbake: runqueue: Move decision if a task can be started to one common place
(Bitbake rev: 99d9e4389e1f1d78d17a23ee078fe3f4a12cb31d) Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 400709c160..7095ea5abc 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -199,7 +199,7 @@ class RunQueueScheduler(object):
199 """ 199 """
200 Return the id of the task we should build next 200 Return the id of the task we should build next
201 """ 201 """
202 if self.rq.stats.active < self.rq.number_tasks: 202 if self.rq.can_start_task():
203 return self.next_buildable_task() 203 return self.next_buildable_task()
204 204
205 def newbuildable(self, task): 205 def newbuildable(self, task):
@@ -1754,6 +1754,10 @@ class RunQueueExecute:
1754 valid = bb.utils.better_eval(call, locs) 1754 valid = bb.utils.better_eval(call, locs)
1755 return valid 1755 return valid
1756 1756
1757 def can_start_task(self):
1758 can_start = self.stats.active < self.number_tasks
1759 return can_start
1760
1757class RunQueueExecuteDummy(RunQueueExecute): 1761class RunQueueExecuteDummy(RunQueueExecute):
1758 def __init__(self, rq): 1762 def __init__(self, rq):
1759 self.rq = rq 1763 self.rq = rq
@@ -2044,7 +2048,7 @@ class RunQueueExecuteTasks(RunQueueExecute):
2044 self.build_stamps2.append(self.build_stamps[task]) 2048 self.build_stamps2.append(self.build_stamps[task])
2045 self.runq_running.add(task) 2049 self.runq_running.add(task)
2046 self.stats.taskActive() 2050 self.stats.taskActive()
2047 if self.stats.active < self.number_tasks: 2051 if self.can_start_task():
2048 return True 2052 return True
2049 2053
2050 if self.stats.active > 0: 2054 if self.stats.active > 0:
@@ -2404,7 +2408,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
2404 self.rq.read_workers() 2408 self.rq.read_workers()
2405 2409
2406 task = None 2410 task = None
2407 if self.stats.active < self.number_tasks: 2411 if self.can_start_task():
2408 # Find the next setscene to run 2412 # Find the next setscene to run
2409 for nexttask in self.rqdata.runq_setscene_tids: 2413 for nexttask in self.rqdata.runq_setscene_tids:
2410 if nexttask in self.runq_buildable and nexttask not in self.runq_running and self.stamps[nexttask] not in self.build_stamps.values(): 2414 if nexttask in self.runq_buildable and nexttask not in self.runq_running and self.stamps[nexttask] not in self.build_stamps.values():
@@ -2463,7 +2467,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
2463 self.build_stamps2.append(self.build_stamps[task]) 2467 self.build_stamps2.append(self.build_stamps[task])
2464 self.runq_running.add(task) 2468 self.runq_running.add(task)
2465 self.stats.taskActive() 2469 self.stats.taskActive()
2466 if self.stats.active < self.number_tasks: 2470 if self.can_start_task():
2467 return True 2471 return True
2468 2472
2469 if self.stats.active > 0: 2473 if self.stats.active > 0: