On Tue, 28 Mar 2023 21:39:21 GMT, Daniel D. Daugherty <dcu...@openjdk.org> wrote:
>> src/hotspot/share/runtime/threads.cpp line 1433: >> >>> 1431: >>> 1432: JavaThread* Threads::owning_thread_from_monitor(ThreadsList* t_list, >>> ObjectMonitor* monitor) { >>> 1433: assert(SafepointSynchronize::is_at_safepoint(), "not safe outside >>> of safepoint"); >> >> Shouldn't this be gated on UseFastLocking? > > Hmmm.... `owning_thread_from_monitor()` is only called from > `ObjectSynchronizer::get_lock_owner()` when `get_lock_owner()` > knows that it has an ObjectMonitor in hand. I'm not at all sure that > we can assert that `ObjectSynchronizer::get_lock_owner()` is > only called from a safepoint. There has been a single call path from management.cpp that is not calling this code at a safepoint, and I changed that code to take the safepoint-taking variant code-path when using UseFastLocking. That path already existed and has been used when max_depth == 0. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1153307575