From: Richard Purdie Date: Fri, 31 Jan 2014 11:17:34 +0000 (+0000) Subject: bitbake: runqueue: Fix race against tasks sharing stamp files X-Git-Tag: rev_ivi_2015_02_04~9459 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b3732d996131d6377e4ed5f6ee48e913ad15cfe;p=scm%2Fbb%2Ftizen-distro.git bitbake: runqueue: Fix race against tasks sharing stamp files Shared work directories work by assuming bitbake will not run more than one task with a specific stamp name. Recent runqueue optimisations accidentally broke this meaning there could be races. This fixes the code. (Bitbake rev: b1628b1a260ddf43fc9985535b1ddcfcebbb1e5b) Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 0475ee2..91b1f07 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -125,7 +125,10 @@ class RunQueueScheduler(object): if not self.buildable: return None if len(self.buildable) == 1: - return self.buildable[0] + taskid = self.buildable[0] + stamp = self.stamps[taskid] + if stamp not in self.rq.build_stamps.itervalues(): + return taskid if not self.rev_prio_map: self.rev_prio_map = range(self.numTasks)