X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2FMainProgram.java;h=52be328eb87ea5de7d9b58fed20e1fe53439f727;hp=1e4b5cbac508623fff9fd9d5017043818ce1ee42;hb=d3f7c0196ecf58b78574d8b80e1844ecb4e223d6;hpb=b055bfb36cca301ceed0591028d245e152c8c32d 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 1e4b5cbac..52be328eb 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()) { @@ -165,6 +167,9 @@ public class MainProgram implements Runnable, Closeable { for(int i=0;i> entry : updates.entrySet()) {