]> 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 c5cf5f7bf1d31be3502473bd0e1a82aa7a5c8c09..d48f9ba6da792f6c292f1ac4ac14cf01aaadbd95 100644 (file)
@@ -159,21 +159,18 @@ class OperationQueue {
         */
        synchronized long waitFor() {
 
-           mainProgram.assertMainProgramThread();
-
-           // One last check within the monitor 
-           if(!operations.isEmpty() || !tasks.isEmpty()) return 0;
+               mainProgram.assertMainProgramThread();
 
-           long start = System.nanoTime();
+               // One last check within the monitor 
+               if(!operations.isEmpty() || !tasks.isEmpty()) return 0;
 
-           try {
-               wait(5000);
-           } catch (InterruptedException e) {
-               LOGGER.error("Unexpected interruption", e);
-           }
-           
-           return System.nanoTime() - start;
+               long start = System.nanoTime();
+               try {
+                       wait(5000);
+               } catch (InterruptedException e) {
+                       LOGGER.error("Unexpected interruption", e);
+               }
+               return System.nanoTime() - start;
 
        }
-
 }