From 1b6efbcb17b7cf648145f83b1a82f6e1c1dce22e Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Wed, 26 Sep 2018 13:58:58 +0300 Subject: [PATCH] Fixed race condition in DynamicExperimentThread. gitlab #136 Change-Id: I533e274bef62e7ce939c9a67a37d8e86d6f38bce --- .../simantics/simulator/toolkit/DynamicExperimentThread.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bundles/org.simantics.simulator.toolkit/src/org/simantics/simulator/toolkit/DynamicExperimentThread.java b/bundles/org.simantics.simulator.toolkit/src/org/simantics/simulator/toolkit/DynamicExperimentThread.java index e3e4f9ba5..0967bfdbc 100644 --- a/bundles/org.simantics.simulator.toolkit/src/org/simantics/simulator/toolkit/DynamicExperimentThread.java +++ b/bundles/org.simantics.simulator.toolkit/src/org/simantics/simulator/toolkit/DynamicExperimentThread.java @@ -151,9 +151,8 @@ abstract public class DynamicExperimentThread extends Thread { } else { - while(!inState(StandardExperimentStates.Running.class) && inActiveState()) { - - synchronized(tasks) { + synchronized(tasks) { + while(!inState(StandardExperimentStates.Running.class) && inActiveState()) { int ran = runTasks(); if(ran == 0) { try { -- 2.47.1