[crac] RFR: Prevent an assertion: Attempting to acquire lock PeriodicTask_lock... [v2]

Jan Kratochvil jkratochvil at openjdk.org
Mon Aug 21 17:17:25 UTC 2023

On Mon, 21 Aug 2023 10:00:44 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:
>>   Move a part of wakeup_threads_in_timedwait() out of VM_Operation.
>>    - suggested by Anton Kozlov
> src/hotspot/share/runtime/crac.cpp line 299:
>> 297:   Threads::java_threads_do(&wc);
>> 298: 
>> 299:   MonitorLocker ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
> I see the problematic locking is performed during the safepoint. The code was added in https://github.com/openjdk/crac/pull/85. AFAICS it's enough to wake up all threads to make them recompute the current time. As more simple approach, would it be enough to move wakeup_threads_in_timedwait out from VM Operation?

Yes, you are right.


PR Review Comment: https://git.openjdk.org/crac/pull/106#discussion_r1300419734

More information about the crac-dev mailing list