X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2FOperationQueue.java;fp=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2FOperationQueue.java;h=d48f9ba6da792f6c292f1ac4ac14cf01aaadbd95;hb=ee8f590cd00bf1f046062f623b024f26ef17f4e1;hp=c5cf5f7bf1d31be3502473bd0e1a82aa7a5c8c09;hpb=63369acd7e6020a2148f40f6bab96b0b2ba392d8;p=simantics%2Fplatform.git 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 c5cf5f7bf..d48f9ba6d 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/OperationQueue.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/OperationQueue.java @@ -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; } - }