From: Jussi Koskela Date: Wed, 22 Nov 2017 14:19:18 +0000 (+0200) Subject: Wake up Acorn Core Main Program on commit X-Git-Tag: v1.31.0~25 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=08a63fb900c9d91a1b13de6a629b377da71ef19f;p=simantics%2Fplatform.git Wake up Acorn Core Main Program on commit Without this fix undo operations take up to 5 seconds. refs #7635 Change-Id: I5e1d5d05d27544f2c30a2d31cf038ce1a8a64e86 --- 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 c69c7bea6..ecc9649f3 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java @@ -128,7 +128,7 @@ public class MainProgram implements Runnable, Closeable { try { long start = System.nanoTime(); mutex.release(); - MainProgram.this.wait(5000); + MainProgram.this.wait(5000); // wake up when new operations are scheduled or the last operation is committed mutex.acquire(); if (!alive) break main; @@ -322,7 +322,10 @@ public class MainProgram implements Runnable, Closeable { LOGGER.error("Trying to commit operation after MainProgram is closed! Operation is " + last); // return; } - if(last != null) last.commit(); + if(last != null) { + last.commit(); + notifyAll(); + } }