On Wed, 4 Jan 2023 07:45:48 GMT, Serguei Spitsyn <[email protected]> wrote:
>> src/hotspot/share/prims/jvmtiThreadState.cpp line 482:
>>
>>> 480: _VTMS_transition_disable_for_all_count > 0) {
>>> 481: MonitorLocker ml(JvmtiVTMSTransition_lock,
>>> Mutex::_no_safepoint_check_flag);
>>> 482: ml.notify_all();
>>
>> Checking the counts outside the lock seems really racy. Maybe it is safe in
>> the original code but now we have two counters it is very hard to ascertain
>> this is correct. Overall I find it very hard to see exactly how these
>> counters get used.
>
> This notification code is just an optimization. All related waiting fragments
> are with timeouts.
> I agree this sync protocol is kind of complicated and also does not scale
> well. I'm still thinking on how to improve it.
I have a two week vacation starting from Monday.
Not sure, that I'll be able to see review comments this time.
-------------
PR: https://git.openjdk.org/jdk/pull/11690