summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-02-16 15:18:06 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-21 13:48:39 +0000
commit0f42f6b640813ca4d5a9d7b4292dafea563d2d7d (patch)
tree1aab7ad15c34d7b4b9809f111fc4b17d6e948ec6 /bitbake
parentec071acf23c494168f5d7934bca93466fffb2b68 (diff)
downloadpoky-0f42f6b640813ca4d5a9d7b4292dafea563d2d7d.tar.gz
runqueue: pass a copy of the RunQueueStats to events
This avoids cases where the stats are modified after the event is fired but before it's dispatched to the UI. (Bitbake rev: 1954f182687a0bd429175dda87f05d8a94bb403a) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 8a88fe026d..abf7c003e5 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -46,6 +46,14 @@ class RunQueueStats:
46 self.active = 0 46 self.active = 0
47 self.total = total 47 self.total = total
48 48
49 def copy(self):
50 obj = self.__class__(self.total)
51 obj.completed = self.completed
52 obj.skipped = self.skipped
53 obj.failed = self.failed
54 obj.active = self.active
55 return obj
56
49 def taskFailed(self): 57 def taskFailed(self):
50 self.active = self.active - 1 58 self.active = self.active - 1
51 self.failed = self.failed + 1 59 self.failed = self.failed + 1
@@ -1594,7 +1602,7 @@ class runQueueEvent(bb.event.Event):
1594 def __init__(self, task, stats, rq): 1602 def __init__(self, task, stats, rq):
1595 self.taskid = task 1603 self.taskid = task
1596 self.taskstring = rq.rqdata.get_user_idstring(task) 1604 self.taskstring = rq.rqdata.get_user_idstring(task)
1597 self.stats = stats 1605 self.stats = stats.copy()
1598 bb.event.Event.__init__(self) 1606 bb.event.Event.__init__(self)
1599 1607
1600class runQueueTaskStarted(runQueueEvent): 1608class runQueueTaskStarted(runQueueEvent):