X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2FMainProgram.java;fp=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2FMainProgram.java;h=ff0ab493870e54878d54eaa3774fbbb7a78c85f5;hb=07710b8d5004ddfc203ff18a2c3f7a361f952c52;hp=ec4d56c211ad54640d6d6f429d8847e8d6bf7760;hpb=1c8c22f795944c25fd76d99117e581b7d1b3f351;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java index ec4d56c21..ff0ab4938 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java @@ -70,7 +70,7 @@ public class MainProgram implements Runnable, Closeable { this.updateSchedules = new ArrayList[CLUSTER_THREADS]; for(int i=0;i(); + updateSchedules[i] = new ArrayList<>(); } } @@ -93,11 +93,13 @@ public class MainProgram implements Runnable, Closeable { try { + TreeMap> updates = new TreeMap<>(clusterComparator); + main: while(alive) { - TreeMap> updates = new TreeMap>(clusterComparator); - + if (!updates.isEmpty()) + updates.clear(); operationQueue.pumpUpdates(updates); if(updates.isEmpty()) { @@ -167,6 +169,9 @@ public class MainProgram implements Runnable, Closeable { for(int i=0;i> entry : updates.entrySet()) {