Remove mixed-size accesses to the LockWord

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • tbd
    • Affects Version/s: 9
    • Component/s: hotspot

      The Lockword in the Mutex/Monitor encodes various bits of information and is usually updated via a full-word atomic CAS. However, an optimization in the unlock path was implemented years ago for sparc/x86 using a non-atomic byte-store of zero into the LSB to clear the lock. It is not clear if architectures other than sparc/x86 guarantee the safety of such mixed accesses and it is suggested to simply replace the store of zero with an atomic decrement.

            Assignee:
            David Holmes
            Reporter:
            David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: