Unconditionally await in awaitUntil (#1499)

Negative numbers are properly handled, which will reduce chances of deadlocks.
This commit is contained in:
Thad House
2018-12-24 13:07:47 -08:00
committed by Peter Johnson
parent 6593f4346e
commit c449ef1064

View File

@@ -276,9 +276,7 @@ public class Watchdog implements Closeable, Comparable<Watchdog> {
private static boolean awaitUntil(Condition cond, long time) {
long delta = time - RobotController.getFPGATime();
try {
if (delta > 0) {
return cond.await(delta, TimeUnit.MICROSECONDS);
}
return cond.await(delta, TimeUnit.MICROSECONDS);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
ex.printStackTrace();