Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
 def shutdown(self):
     if not self.childDidQuit:
         helper.kill(self.pid)