MutexLocker should disallow null Mutexes

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: 17, 21, 22
    • Component/s: hotspot
    • b15

      As seen in JDK-8313081, accidentally passing nullptr Mutex to MutexLocker would just silently avoid the lock.

      There are a few places in Hotspot where we pass nullptr to simulate re-entrancy and/or conditionally take the lock. Those places can be more explicit, and the default MutexLocker can disallow nullptrs for extra safety.

      I have a prototype for this, WIP.

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: