_gfortran_caf_atomic_cas (The GNU Fortran Compiler)

#### 7.2.31 `_gfortran_caf_atomic_cas` — Atomic compare and swap ¶

Synopsis:

  `void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset, int image_index, void *old, void *compare, void *new_val, int *stat, int type, int kind)`

Description:

  Atomic compare and swap of a kind-4 integer or logical variable. Assigns atomically the specified value to the atomic variable, if the latter has the value specified by the passed condition value.

Arguments:

  token | intent(in) An opaque pointer identifying the coarray.
  offset | intent(in) The number of bytes the actual data is shifted compared to the base address of the coarray.
  image_index | intent(in) The ID of the remote image; must be a positive number; zero indicates the current image when used noncoindexed.
  old | intent(out) The value the atomic variable had just before the cas operation.
  compare | intent(in) The value used for comparison.
  new_val | intent(in) The new value for the atomic variable, assigned to the atomic variable, if `compare` equals the value of the atomic variable.
  stat | intent(out) Stores the status STAT= and may be NULL.
  type | intent(in) the data type, i.e. `BT_INTEGER` (1) or `BT_LOGICAL` (2).
  kind | intent(in) The kind value (only 4; always `int`)