release semaphores before stopping simulation (may deadlock)

This commit is contained in:
fros4943 2009-04-23 10:41:35 +00:00
parent 921ceabb50
commit 382d69ed5d
1 changed files with 3 additions and 4 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: LogScriptEngine.java,v 1.10 2009/04/03 17:05:14 fros4943 Exp $ * $Id: LogScriptEngine.java,v 1.11 2009/04/23 10:41:35 fros4943 Exp $
*/ */
package se.sics.cooja.plugins; package se.sics.cooja.plugins;
@ -338,7 +338,6 @@ public class LogScriptEngine {
/*logger.info("test script thread starts");*/ /*logger.info("test script thread starts");*/
try { try {
((Invocable)engine).getInterface(Runnable.class).run(); ((Invocable)engine).getInterface(Runnable.class).run();
} catch (RuntimeException e) { } catch (RuntimeException e) {
Throwable throwable = e; Throwable throwable = e;
while (throwable.getCause() != null) { while (throwable.getCause() != null) {
@ -347,7 +346,7 @@ public class LogScriptEngine {
if (throwable.getMessage() != null && if (throwable.getMessage() != null &&
throwable.getMessage().contains("test script killed") ) { throwable.getMessage().contains("test script killed") ) {
/*logger.info("test script thread terminated by exception");*/ logger.info("Test script finished");
} else { } else {
if (!GUI.isVisualized()) { if (!GUI.isVisualized()) {
logger.fatal("Test script error, terminating Cooja."); logger.fatal("Test script error, terminating Cooja.");
@ -356,8 +355,8 @@ public class LogScriptEngine {
} }
logger.fatal("Script error:", e); logger.fatal("Script error:", e);
gui.getSimulation().stopSimulation();
deactivateScript(); deactivateScript();
gui.getSimulation().stopSimulation();
} }
} }
/*logger.info("test script thread exits");*/ /*logger.info("test script thread exits");*/