def __terminate(self,pid):
sp = self._processes[pid]
for sig, timeout in self._STOP_SIGNALS:
try:
# the group id is used to handle child processes (if they
# exist) of the component being cleaned up
if _domainless._DEBUG == True:
print "_OutputBase: __terminate () making killpg call on pid " + str(pid) + " with signal " + str(sig)
_os.killpg(pid, sig)
except OSError:
log.error("_OutputBase: __terminate() OSERROR ===============")
pass
if timeout != None:
giveup_time = _time.time() + timeout
while sp.poll() == None:
if _time.time() > giveup_time: break
_time.sleep(0.1)
if sp.poll() != None: break
sp.wait()
评论列表
文章目录