Message10978
Presumably we can implement PythonInterpreter#abort using a similar approach to org.python.util.jython#shutdownInterpreter, but to set the restart flag for a specific PySystemState, not the current state as defined by a thread local.
public static void shutdownInterpreter() {
// Stop all the active threads and signal the SystemRestart
thread.interruptAllThreads();
Py.getSystemState()._systemRestart = true;
// Close all sockets -- not all of their operations are stopped by
// Thread.interrupt (in particular pre-nio sockets)
try {
imp.load("socket").__findattr__("_closeActiveSockets").__call__();
} catch (PyException pye) {
// continue
}
}
Note that we should be able to do a better cleanup in as of Jython 2.7 and recent Java - assuming well behaved resources. |
|
Date |
User |
Action |
Args |
2016-10-27 14:37:09 | zyasoft | set | messageid: <1477579029.02.0.171917585932.issue2530@psf.upfronthosting.co.za> |
2016-10-27 14:37:09 | zyasoft | set | recipients:
+ zyasoft, andrewparks |
2016-10-27 14:37:08 | zyasoft | link | issue2530 messages |
2016-10-27 14:37:08 | zyasoft | create | |
|