getAndSet method

T getAndSet(
  1. Int index,
  2. T newValue
)

Atomically sets the value of the element at the given index to the newValue and returns the old value of the element.

Implementation

external T getAndSet(Int index, T newValue);