Add Atomic::fetch_and_add

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 15
    • Affects Version/s: 15
    • Component/s: hotspot
    • b08

      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.

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

              Created:
              Updated:
              Resolved: