From 08a63fb900c9d91a1b13de6a629b377da71ef19f Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Wed, 22 Nov 2017 16:19:18 +0200 Subject: [PATCH] Wake up Acorn Core Main Program on commit Without this fix undo operations take up to 5 seconds. refs #7635 Change-Id: I5e1d5d05d27544f2c30a2d31cf038ce1a8a64e86 --- .../src/org/simantics/acorn/MainProgram.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); + } } -- 2.43.2