diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2012-03-29 20:01:11 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-29 21:25:53 +0100 |
commit | 1da504536af83a8d72673a8090bbd5b8cd38e1f3 (patch) | |
tree | bf5d54497fba83d5b708a87dcc2df011bccf6d9d /bitbake/lib | |
parent | f73ea0e40d0ebe9eaea80ed7b4d36da299e39e62 (diff) | |
download | poky-1da504536af83a8d72673a8090bbd5b8cd38e1f3.tar.gz |
command.py: Move triggerEvent to command async class
The parameters in triggerEvent function is an event object, and it may
cost some time to pass this object through pipe, causing the pipe's
poll() function timeout. Change it to async mode.
(Bitbake rev: 3b5909ebc86a12dedfb30e5446aa81eb58921760)
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/command.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 1799f1cc3c..73aaca0474 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -179,13 +179,6 @@ class CommandsSync: | |||
179 | """ | 179 | """ |
180 | return bb.utils.cpu_count() | 180 | return bb.utils.cpu_count() |
181 | 181 | ||
182 | def triggerEvent(self, command, params): | ||
183 | """ | ||
184 | Trigger a certain event | ||
185 | """ | ||
186 | event = params[0] | ||
187 | bb.event.fire(eval(event), command.cooker.configuration.data) | ||
188 | |||
189 | class CommandsAsync: | 182 | class CommandsAsync: |
190 | """ | 183 | """ |
191 | A class of asynchronous commands | 184 | A class of asynchronous commands |
@@ -359,3 +352,13 @@ class CommandsAsync: | |||
359 | command.cooker.parseConfigurationFiles(prefiles, postfiles) | 352 | command.cooker.parseConfigurationFiles(prefiles, postfiles) |
360 | command.finishAsyncCommand() | 353 | command.finishAsyncCommand() |
361 | parseConfigurationFiles.needcache = False | 354 | parseConfigurationFiles.needcache = False |
355 | |||
356 | def triggerEvent(self, command, params): | ||
357 | """ | ||
358 | Trigger a certain event | ||
359 | """ | ||
360 | event = params[0] | ||
361 | bb.event.fire(eval(event), command.cooker.configuration.data) | ||
362 | command.currentAsyncCommand = None | ||
363 | triggerEvent.needcache = False | ||
364 | |||