* 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;
|
||||
if (t != null && t.isAlive()) {
|
||||
t.interrupt();
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
if (t.isAlive()) {
|
||||
// thread is still running, gotta stop it.
|
||||
t.stop();
|
||||
if ("true".equals(app.getProperty("requestTimeoutStop", "true"))) {
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
if (t.isAlive()) {
|
||||
// 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