gitlab #440
Change-Id: I9d6b1514907682b990ae21588ced70b35f5ed6f5
- long start = System.nanoTime();
-
- operationQueue.waitFor();
+ long duration = operationQueue.waitFor();
- long duration = System.nanoTime()-start;
if(duration > 4000000000L) {
checkIdle();
}
if(duration > 4000000000L) {
checkIdle();
}
}
// long sss = System.nanoTime();
}
// long sss = System.nanoTime();
* Wake up when new operations are scheduled or the last operation is committed
* Called by MainProgram thread
*/
* 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
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);
}
try {
wait(5000);
} catch (InterruptedException e) {
LOGGER.error("Unexpected interruption", e);
}
+ return System.nanoTime() - start;