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

Use Atomic::replace_if_null

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • None
    • 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).

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

              Created:
              Updated:
              Resolved: