def _terminate_execution(self):
# called from receiverthread
self._trace("shutting down execution pool")
self._execpool.trigger_shutdown()
if not self._execpool.waitall(5.0):
self._trace(
"execution ongoing after 5 secs,"" trying interrupt_main")
# We try hard to terminate execution based on the assumption
# that there is only one gateway object running per-process.
if sys.platform != "win32":
self._trace("sending ourselves a SIGINT")
os.kill(os.getpid(), 2) # send ourselves a SIGINT
elif interrupt_main is not None:
self._trace("calling interrupt_main()")
interrupt_main()
if not self._execpool.waitall(10.0):
self._trace("execution did not finish in another 10 secs, "
"calling os._exit()")
os._exit(1)
评论列表
文章目录