[crac] RFR: Wake up all TIMED_WAITING threads after restore

Radim Vansa rvansa at openjdk.org
Tue Jun 20 08:38:40 UTC 2023


On Mon, 19 Jun 2023 15:52:59 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

> OS-level spurious wake-ups are fine, but propogating that to java level seems dangerous. I could not spot the example of the propogation. E.g. can that happen to Thread.sleep()?

I've added checks for the actual duration to the test (on my machine the C/R takes about 800 ms, but I've tried with a longer wait time to give it a chance to fail) and the methods that are supposed to guarantee waiting (Thread.sleep/join, tryLock...) work correctly. `Object.wait` and `LockSupport.parkUntil` return spuriously after restore, but spurious return is explicitly allowed in javadoc. `Condition.await` is allowed to return but the implementation tracks the deadline internally and does not return before that.

-------------

PR Comment: https://git.openjdk.org/crac/pull/85#issuecomment-1598353809


More information about the crac-dev mailing list