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

Rename Atomic::fetch_and_add and friends

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 21
    • 21
    • hotspot
    • None
    • b23

    Description

      JDK-8293117 introduced a suite of functions for atomic bit manipulation, with names "fetch_then_OP" and "OP_then_fetch" for the various OPs (and/or/xor). This naming convention was chosen in part because "fetch_and_and" and similar names that would be consistent with the existing "add" variants seemed odd and confusing.

      It would be better to have consistent naming, so we should make these name changes:
      - "fetch_and_add" => "fetch_then_add"
      - "add_and_fetch" => "add_then_fetch"

      Note that there are currently no uses of "add_and_fetch" outside the implementation of Atomic. Also note that we don't currently have subtraction variants of either.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: