diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-02-16 15:18:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-21 13:48:39 +0000 |
commit | 0f42f6b640813ca4d5a9d7b4292dafea563d2d7d (patch) | |
tree | 1aab7ad15c34d7b4b9809f111fc4b17d6e948ec6 /bitbake/lib | |
parent | ec071acf23c494168f5d7934bca93466fffb2b68 (diff) | |
download | openembedded-core-0f42f6b640813ca4d5a9d7b4292dafea563d2d7d.tar.gz openembedded-core-0f42f6b640813ca4d5a9d7b4292dafea563d2d7d.tar.bz2 openembedded-core-0f42f6b640813ca4d5a9d7b4292dafea563d2d7d.tar.xz openembedded-core-0f42f6b640813ca4d5a9d7b4292dafea563d2d7d.zip |
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/lib')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 8a88fe026..abf7c003e 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -46,6 +46,14 @@ class RunQueueStats: self.active = 0 self.total = total + def copy(self): + obj = self.__class__(self.total) + obj.completed = self.completed + obj.skipped = self.skipped + obj.failed = self.failed + obj.active = self.active + return obj + def taskFailed(self): self.active = self.active - 1 self.failed = self.failed + 1 @@ -1594,7 +1602,7 @@ class runQueueEvent(bb.event.Event): def __init__(self, task, stats, rq): self.taskid = task self.taskstring = rq.rqdata.get_user_idstring(task) - self.stats = stats + self.stats = stats.copy() bb.event.Event.__init__(self) class runQueueTaskStarted(runQueueEvent): |