Module Atomic.Loc

Atomic "locations", such as record fields.

type t('a) = atomic_loc('a);

This module exposes a dedicated type 'a Atomic.Loc.t for atomic locations (storing a value of type 'a) inside objects that may not be atomic references. It is used in particular for atomic record fields: if a record r has an atomic field f of type foo, then [%atomic.loc r.f] has type foo Atomic.Loc.t. The API below mirrors the API to access atomic references, see the documentation above for more information.

let get: t('a) => 'a;
let set: t('a) => 'a => unit;
let exchange: t('a) => 'a => 'a;
let compare_and_set: t('a) => 'a => 'a => bool;
let fetch_and_add: t(int) => int => int;
let incr: t(int) => unit;
let decr: t(int) => unit;