On Fri, 16 Dec 2022 14:14:54 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
>> src/hotspot/share/prims/jvmtiThreadState.cpp line 304: >> >>> 302: >>> 303: ThreadBlockInVM tbivm(thread); >>> 304: MonitorLocker ml(JvmtiVTMSTransition_lock, >>> Mutex::_no_safepoint_check_flag); >> >> Aside: this pattern looks very odd. Why not just lock with the safepoint >> check? > > @dholmes-ora > Thank you for looking at this fix and for the comments. > I will on replying and resolving them. This update just follows the common pattern which was introduced about two years ago. At the moment I do not remember the exact reason. This code needs to wait for the counter to become zero and to use `ThreadBlockInVM` which can reach a safepoint in the destructor. Can we lock with a safepoint check in this case? Or we should get rid of the `ThreadBlockInVM` then? I'll check if this can be fixed. ------------- PR: https://git.openjdk.org/jdk/pull/11690