We have over 250 cases of this pattern in HotSpot
MutexLocker locker(Some_lock, Mutex::_no_safepoint_check_flag);
Yet there's no documentation of that the "flag" petameter does [1]
At the declaration of _no_safepoint_check_flag, there's a general discussion about lock acquisition and safepoint checks. However, there's no precise definition of what _no_safepoint_check_flag does [2].
Since locking and safepoints are a critical part of the VM, the documentation should be improved so people can correctly pick the right "flag" for MutexLocker.
********************************
[1] https://github.com/openjdk/jdk/blob/ce896731d38866c2bf99cd49525062e150d94160/src/hotspot/share/runtime/mutexLocker.hpp#L194-L216
[2] https://github.com/openjdk/jdk/blob/ce896731d38866c2bf99cd49525062e150d94160/src/hotspot/share/runtime/mutex.hpp#L135-L148
MutexLocker locker(Some_lock, Mutex::_no_safepoint_check_flag);
Yet there's no documentation of that the "flag" petameter does [1]
At the declaration of _no_safepoint_check_flag, there's a general discussion about lock acquisition and safepoint checks. However, there's no precise definition of what _no_safepoint_check_flag does [2].
Since locking and safepoints are a critical part of the VM, the documentation should be improved so people can correctly pick the right "flag" for MutexLocker.
********************************
[1] https://github.com/openjdk/jdk/blob/ce896731d38866c2bf99cd49525062e150d94160/src/hotspot/share/runtime/mutexLocker.hpp#L194-L216
[2] https://github.com/openjdk/jdk/blob/ce896731d38866c2bf99cd49525062e150d94160/src/hotspot/share/runtime/mutex.hpp#L135-L148