def die(self, stage): self._log("die: stage %d" % stage) if self.didQuit: return if stage == 0: self.childShallQuit = True self.internConnector.die() self.dispatcher.addWithTimeout(self.shutdownTimeout, self.die, 1) elif stage == 1: helper.kill(self.pid) self.dispatcher.addWithTimeout(self.killTimeout, self.die, 2) elif stage == 2: self._log("could not terminate simulation process (pid == %d)" % self.pid) self._quit()
def shutdown(self): if not self.childDidQuit: helper.kill(self.pid)