*/
synchronized long waitFor() {
- mainProgram.assertMainProgramThread();
-
- // One last check within the monitor
- if(!operations.isEmpty() || !tasks.isEmpty()) return 0;
+ mainProgram.assertMainProgramThread();
- long start = System.nanoTime();
- System.err.println("start =" + start);
+ // 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;
}
-
}