* Make usage of deprecated Thread.stop() dependent on setting of
requestTimeoutStop = true|false app property
This commit is contained in:
parent
5c1714d855
commit
676f4a06f0
1 changed files with 9 additions and 7 deletions
|
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue