Returns the remaining nanos until the given timeout, or 0L if the timeout has already elapsed. Caller must have previously sanitized timeoutNanos using toSafeNanos.
(long startTime, long timeoutNanos)
| 996 | */ |
| 997 | |
| 998 | private static long remainingNanos(long startTime, long timeoutNanos) { |
| 999 | // assert timeoutNanos == 0L || startTime != 0L; |
| 1000 | |
| 1001 | // TODO : NOT CORRECT, BUT TESTS PASS ANYWAYS! |
| 1002 | // if (true) return timeoutNanos; |
| 1003 | // ONLY 2 TESTS FAIL IF WE DO: |
| 1004 | // if (true) return 0; |
| 1005 | return (timeoutNanos <= 0L) ? 0L : timeoutNanos - (System.nanoTime() - startTime); |
| 1006 | } |
| 1007 | |
| 1008 | /** |
| 1009 | * Signals some other thread waiting on a satisfied guard, if one exists. |
no outgoing calls
no test coverage detected