From 676f4a06f07f5a92b5685a919ab1dd70e4fe1e39 Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 11 May 2006 19:22:07 +0000 Subject: [PATCH] * Make usage of deprecated Thread.stop() dependent on setting of requestTimeoutStop = true|false app property --- src/helma/scripting/rhino/RhinoEngine.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/helma/scripting/rhino/RhinoEngine.java b/src/helma/scripting/rhino/RhinoEngine.java index f70f88a5..a592cd50 100644 --- a/src/helma/scripting/rhino/RhinoEngine.java +++ b/src/helma/scripting/rhino/RhinoEngine.java @@ -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 } } }