From patchwork Thu Mar 29 12:01:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel, 05/14] command.py: Move triggerEvent to command async class Date: Thu, 29 Mar 2012 12:01:11 -0000 From: Dongxiao Xu X-Patchwork-Id: 24817 Message-Id: <6f2d9f8a3e548dbf9ae34b6c53a85165d0d3ec99.1333022081.git.dongxiao.xu@intel.com> To: bitbake-devel@lists.openembedded.org 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. Signed-off-by: Dongxiao Xu --- lib/bb/command.py | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/bb/command.py b/lib/bb/command.py index 1799f1c..73aaca0 100644 --- a/lib/bb/command.py +++ b/lib/bb/command.py @@ -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 +