Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8298229

Improve documentation for MutexLocker

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 21
    • None
    • hotspot

      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

            coleenp Coleen Phillimore
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: