Module Atomic.LocSource
Atomic "locations", such as record fields.
Sourcetype ('a : value_or_null) t : sync_data with 'a = 'a atomic_loc 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.
Sourceval get : ('a : value_or_null). 'a t @ local -> 'a Sourceval get_contended :
('a : value_or_null). 'a t @ local contended ->
'a @ contended Sourceval set : ('a : value_or_null). 'a t @ local -> 'a -> unit Sourceval exchange : ('a : value_or_null). 'a t @ local -> 'a -> 'a Sourceval compare_and_set : ('a : value_or_null). 'a t @ local -> 'a -> 'a -> bool Sourceval compare_exchange : ('a : value_or_null). 'a t @ local -> 'a -> 'a -> 'a Sourceval fetch_and_add : int t @ local -> int -> int Sourceval add : int t @ local -> int -> unit Sourceval sub : int t @ local -> int -> unit Sourceval logand : int t @ local -> int -> unit Sourceval logor : int t @ local -> int -> unit Sourceval logxor : int t @ local -> int -> unit Sourceval incr : int t @ local -> unit Sourceval decr : int t @ local -> unit