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

Add Atomic::fetch_and_add

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 15
    • 15
    • hotspot
    • b08

    Description

      There are a number of places where we have this pattern:
      int result = Atomic::add(_index, amount) - amount;

      I'd like to introduce Atomic::fetch_and_add so that we can write:
      int result = Atomic::fetch_and_add(_index, amount);

      The current implementation already has support for both "add and fetch" and "fetch and add" but it's not exposed to the upper layers.

      Attachments

        Activity

          People

            stefank Stefan Karlsson
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: