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

Add Atomic::fetch_and_add

XMLWordPrintable

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

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

              Created:
              Updated:
              Resolved: