]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
More trace logging to find out what's stopping sequences
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 15 Oct 2022 15:52:49 +0000 (18:52 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sat, 15 Oct 2022 15:52:49 +0000 (18:52 +0300)
bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java

index 2900fb07e3ee94538411c4db2ea8f9ff329f21c3..167643af9cb718cd37d1ac64f78866beaeaf0ab0 100644 (file)
@@ -18,7 +18,7 @@ public abstract class AbstractActionContext implements ActionContext {
     public static final double TIME_TOLERANCE = 1e-6;
     
     double currentTime;
-    volatile boolean stopped;
+    volatile boolean stopped = false;
     ArrayList<Function1<Tuple0, Object>> scheduledNow = new ArrayList<>();
     ArrayList<Function1<Tuple0, Object>> scheduledNextStep = new ArrayList<>();
     ArrayList<Function1<StopReason, Object>> scheduledWhenStopped = new ArrayList<>();
@@ -118,8 +118,11 @@ public abstract class AbstractActionContext implements ActionContext {
                        }
                        Task firstTask = scheduledAt.peek();
                        if(firstTask == null) {
-                           if (scheduledNextStep.isEmpty())
+                           if (scheduledNextStep.isEmpty()) {
+                               if (LOGGER.isTraceEnabled())
+                                   LOGGER.trace("No work to schedule, stopping empty sequence", new Exception("trace"));
                                stopped = true;
+                           }
                            return Double.POSITIVE_INFINITY;
                        } else if(firstTask.time > currentTime+TIME_TOLERANCE) {
                            return firstTask.time;