Use Atomic::replace_if_null

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 11
    • Affects Version/s: None
    • Component/s: hotspot
    • None
    • b01
    • generic
    • generic

      Atomic::replace_if_null was added (by JDK-8186166) to simplify a common use-case for Atomic::cmpxchg, where the old value to be replaced is NULL (which needs to be cast to the proper type), and the caller needs a success/failure result for the cmpxchg.

      When Atomic::cmpxchg_ptr calls were converted to make use of the new templatized implementation (JDK-8188220), all such calls were converted to Atomic::cmpxchg, even where Atomic::replace_if_null could have been used. Those places which could use Atomic::replace_if_null should be converted to do so. (Or else we should just eliminate replace_if_null).

            Assignee:
            Kim Barrett
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: