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

Anton Kozlov akozlov at openjdk.org
Mon Aug 21 10:03:59 UTC 2023


On Sun, 20 Aug 2023 16:24:50 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

> Prevent an assertion: `Attempting to acquire lock PeriodicTask_lock/safepoint out of order with lock Threads_lock/safepoint-1 -- possible deadlock`

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?

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

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


More information about the crac-dev mailing list