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

MutexLocker should disallow null Mutexes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 17, 21, 22
    • 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.

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

              Created:
              Updated:
              Resolved: