atomicAdd method

  1. @override
int atomicAdd(
  1. int index,
  2. int value
)
override

Atomically adds value to the 32-bit element at index and returns the previous value. index is in Int32 elements, not bytes.

Implementation

@override
int atomicAdd(int index, int value) {
  _checkIndex(index);
  final previous = _atomicView[index];
  _atomicView[index] = previous + value;
  return previous;
}