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%2FOperationQueue.java;h=a85aa882930446b6214e4bd5116b8e3358233930;hp=7a9d8aba23f1b714d190a92552f879066775a94e;hb=0df63f38249cbbc584d3a130773680c309fb1f71;hpb=6e5b9075f92c1f4f478a09f78d9b710613f8e601 diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/OperationQueue.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/OperationQueue.java index 7a9d8aba2..a85aa8829 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/OperationQueue.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/OperationQueue.java @@ -157,18 +157,20 @@ class OperationQueue { * Wake up when new operations are scheduled or the last operation is committed * Called by MainProgram thread */ - synchronized void waitFor() { + synchronized long waitFor() { mainProgram.assertMainProgramThread(); // One last check within the monitor - if(!operations.isEmpty() || !tasks.isEmpty()) return; + if(!operations.isEmpty() || !tasks.isEmpty()) return 0; + long start = System.nanoTime(); try { wait(5000); } catch (InterruptedException e) { LOGGER.error("Unexpected interruption", e); } + return System.nanoTime() - start; }