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>
This commit is contained in:
Dongxiao Xu 2012-03-29 20:01:11 +08:00 committed by Richard Purdie
parent f73ea0e40d
commit 1da504536a
1 changed files with 10 additions and 7 deletions

View File

@ -179,13 +179,6 @@ class CommandsSync:
"""
return bb.utils.cpu_count()
def triggerEvent(self, command, params):
"""
Trigger a certain event
"""
event = params[0]
bb.event.fire(eval(event), command.cooker.configuration.data)
class CommandsAsync:
"""
A class of asynchronous commands
@ -359,3 +352,13 @@ class CommandsAsync:
command.cooker.parseConfigurationFiles(prefiles, postfiles)
command.finishAsyncCommand()
parseConfigurationFiles.needcache = False
def triggerEvent(self, command, params):
"""
Trigger a certain event
"""
event = params[0]
bb.event.fire(eval(event), command.cooker.configuration.data)
command.currentAsyncCommand = None
triggerEvent.needcache = False