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

MutexLocker should disallow null Mutexes

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • 17, 21, 22
    • hotspot
    • b15

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: