* Make usage of deprecated Thread.stop() dependent on setting of

requestTimeoutStop = true|false app property
This commit is contained in:
hns 2006-05-11 19:22:07 +00:00
parent 5c1714d855
commit 676f4a06f0

View file

@ -386,14 +386,16 @@ public class RhinoEngine implements ScriptingEngine {
Thread t = thread; Thread t = thread;
if (t != null && t.isAlive()) { if (t != null && t.isAlive()) {
t.interrupt(); t.interrupt();
try { if ("true".equals(app.getProperty("requestTimeoutStop", "true"))) {
Thread.sleep(5000); try {
if (t.isAlive()) { Thread.sleep(5000);
// thread is still running, gotta stop it. if (t.isAlive()) {
t.stop(); // thread is still running, gotta stop it.
t.stop();
}
} catch (InterruptedException i) {
// interrupted, ignore
} }
} catch (InterruptedException i) {
// interrupted, ignore
} }
} }
} }