]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/OperationQueue.java
Merge remote-tracking branch 'origin/master' into private/antti2
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / OperationQueue.java
index 7a9d8aba23f1b714d190a92552f879066775a94e..d48f9ba6da792f6c292f1ac4ac14cf01aaadbd95 100644 (file)
@@ -157,19 +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;
 
        }
-
 }