On Tue, 16 Dec 2025 21:44:20 GMT, Leonid Mesnik <[email protected]> wrote:

>> src/hotspot/share/prims/jvmtiTagMap.cpp line 1210:
>> 
>>> 1208:       // This another thread might have safepoints during event 
>>> callbacks.
>>> 1209:       ThreadBlockInVM tbivm(JavaThread::current());
>>> 1210:       MonitorLocker ml(lock(), Mutex::_no_safepoint_check_flag);
>> 
>> Why not just remove the "no safepoint check" from the MonitorLocker?
>
> This is lock is used in different places, including 
> `JvmtiTagMap::check_hashmaps_for_heapwalk`
> which is called from VMThread. 
> Thus JvmtiTagMap_lock can't has rank `safepoint` and this `MonitorLocker` 
> should also has `_no_safepoint_check_flag`.

Okay. It does seem like the one case of waiting for event posting to complete, 
is the only place we need to be safepoint-safe.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28839#discussion_r2624900432

Reply via email to