From 359a4d8bf72867b4d5f3daaf8c4f14a82a810107 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 18 Feb 2011 11:43:32 +0000 Subject: bitbake/runqueue.py: Move SIGCHLD handler to wrap none server sleep call Signed-off-by: Richard Purdie --- bitbake/lib/bb/runqueue.py | 7 ------- bitbake/lib/bb/server/none.py | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 7d1f48aee2..8a88fe026d 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -748,9 +748,6 @@ class RunQueueData: self.rqdata.runq_depends[task], self.rqdata.runq_revdeps[task]) -# Dummy signal handler to ensure we break out of sleep upon SIGCHLD -def chldhandler(signum, stackframe): - pass class RunQueue: def __init__(self, cooker, cfgData, dataCache, taskData, targets): @@ -764,8 +761,6 @@ class RunQueue: self.state = runQueuePrepare - signal.signal(signal.SIGCHLD, chldhandler) - def check_stamps(self): unchecked = {} current = [] @@ -1107,8 +1102,6 @@ class RunQueueExecute: # themselves bblogger.handlers = [bb.event.LogHandler()] - signal.signal(signal.SIGCHLD, signal.SIG_DFL) - self.rq.state = runQueueChildProcess # Make the child the process group leader os.setpgid(0, 0) diff --git a/bitbake/lib/bb/server/none.py b/bitbake/lib/bb/server/none.py index 2708807dfc..be0fb8f776 100644 --- a/bitbake/lib/bb/server/none.py +++ b/bitbake/lib/bb/server/none.py @@ -36,6 +36,7 @@ import bb from bb.ui import uievent import xmlrpclib import pickle +import signal DEBUG = False @@ -105,6 +106,10 @@ class BBUIEventQueue: def system_quit( self ): bb.event.unregister_UIHhandler(self.EventHandle) +# Dummy signal handler to ensure we break out of sleep upon SIGCHLD +def chldhandler(signum, stackframe): + pass + class BitBakeServer(): # remove this when you're done with debugging # allow_reuse_address = True @@ -144,7 +149,9 @@ class BitBakeServer(): pass if nextsleep is not None: #print "Sleeping for %s (%s)" % (nextsleep, delay) + signal.signal(signal.SIGCHLD, chldhandler) time.sleep(nextsleep) + signal.signal(signal.SIGCHLD, signal.SIG_DFL) def server_exit(self): # Tell idle functions we're exiting -- cgit v1.2.3