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

Use MonitorLocker rather than MutexLocker when wait/notify used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19

      Description

      The pattern:
      MutexLocker ml(x_lock);
      x_lock->wait();

      Should be replaced with:
      MonitorLocker ml(x_lock);
      ml.wait();

      Then the wait call wouldn't have to differentiate whether it needs a safepoint check based on the way the lock was acquired in the MutexLocker constructors. Also, it would prevent using the wrong lock in the wait.

      The one MonitorLocker that is NULL should be made non-null and NULL MonitorLocker should be disallowed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              coleenp Coleen Phillimore
              Reporter:
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: