On Mon, 11 Mar 2024 18:08:14 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
>> Sorry I missed this response. I can't see a way to address spurious wakeups >> in this case as it needs to be a per-thread flag (so that each thread knows >> it was notified) but you don't know which thread will be notified in any >> given call to `notify()`. I also can't see how you can detect a spurious >> wakeup in this code. If they happen then a subtest may fail due to an >> unexpected number of re-entering threads. >> I think we will just have to see how stable the test is in practice. > > Okay, thanks! I'll add some diagnostic code to catch spurious wakups. > Let's see if we ever encounter any spurious wakeup in this test. I think some sort of comment needs to be added here to document the possibility of this code path being affect by a spurious wakeup. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17680#discussion_r1520260059