Loc.Sharedval unsafe_of_atomic_loc : 'a. 'a Atomic.Loc.t @ shared -> 'a t @ sharedLike Subatomic.Loc.unsafe_of_atomic_loc, but for shared values.
val get : 'a. 'a t @ local shared -> 'a @ sharedRead the current value of a subatomic.
get performs a non-atomic read on an uncontended subatomic.get [@synchro atomic] and Shared.get perform an atomic read on a shared subatomic.val set : 'a. 'a t @ local shared -> ('a -> unit) @ localUpdate the current value of a subatomic.
set performs a non-atomic write on an uncontended subatomic.set [@synchro atomic] and Shared.set perform an atomic write on a shared subatomic.val exchange : 'a. 'a t @ local shared -> ('a -> 'a) @ localUpdate the current value of a subatomic, and return the previous value.
update performs a non-atomic read/write on an uncontended subatomic.update [@synchro atomic] and Shared.update perform an atomic read/write on a shared subatomic.val compare_and_set :
'a. 'a t @ local shared ->
(if_phys_equal_to:'a ->
(replace_with:'a ->
Atomic.Compare_failed_or_set_here.t) @ local) @ localIf the current value of the subatomic is phys_equal to if_phys_equal, then update it to replace_with and return Set_here; otherwise, return Compare_failed (with the subatomic left unchanged).
compare_and_set performs a non-atomic read/compare/write on an uncontended subatomic.compare_and_set [@synchro atomic] and Shared.compare_and_set perform an atomic read/compare/write on a shared subatomic.val compare_exchange :
'a. 'a t @ local shared ->
(if_phys_equal_to:'a ->
(replace_with:'a ->
'a) @ local) @ localIf the current value of the subatomic is phys_equal to if_phys_equal, then update it to replace_with and return the previous value; otherwise, return current (unchanged) value.
compare_exchange performs a non-atomic read/compare/write on an uncontended subatomic.compare_exchange [@synchro atomic] and Shared.compare_exchange perform an atomic read/compare/write on a shared subatomic.val update :
'a. 'a t @ local shared ->
(pure_f:('a -> 'a) @ local ->
unit) @ localUpdate t to be the result of pure_f (get t); if t is changed before the whole operation is complete, retry until success. pure_f may be called multiple times, so should be free of side effects.
update performs a non-atomic read/compare/write on an uncontended subatomic. pure_f still may be called multiple times due to nonportable threading or if pure_f is not actually pure.update [@synchro atomic] and Shared.update perform an atomic read/compare/write on a shared subatomic.val get_and_update :
'a. 'a t @ local shared ->
(pure_f:('a -> 'a) @ local ->
'a) @ localUpdate t to be the result of pure_f (get t), and return the old value; if t is changed before the whole operation is complete, retry until success. pure_f may be called multiple times, so should be free of side effects.
get_and_update performs a non-atomic read/compare/write on an uncontended subatomic. pure_f still may be called multiple times due to nonportable threading or if pure_f is not actually pure.get_and_update [@synchro atomic] and Shared.get_and_update perform an atomic read/compare/write on a shared subatomic.val fetch_and_add : int t @ local shared -> (int -> int) @ localIncrements the value of a subatomic by the given value, and return the previous value (before the increment).
fetch_and_add performs a non-atomic update on an uncontended subatomic.fetch_and_add [@synchro atomic] and Shared.fetch_and_add perform an atomic update on a shared subatomic.val add : int t @ local shared -> (int -> unit) @ localAdd the given value to the subatomic.
add performs a non-atomic update on an uncontended subatomic.add [@synchro atomic] and Shared.add perform an atomic update on a shared subatomic.val sub : int t @ local shared -> (int -> unit) @ localSubtract the given value from the subatomic.
sub performs a non-atomic update on an uncontended subatomic.sub [@synchro atomic] and Shared.sub perform an atomic update on a shared subatomic.val logand : int t @ local shared -> (int -> unit) @ localApply bitwise-and of the given value to the subatomic.
logand performs a non-atomic update on an uncontended subatomic.logand [@synchro atomic] and Shared.logand perform an atomic update on a shared subatomic.val logor : int t @ local shared -> (int -> unit) @ localApply bitwise-or of the given value to the subatomic.
logor performs a non-atomic update on an uncontended subatomic.logor [@synchro atomic] and Shared.logor perform an atomic update on a shared subatomic.val logxor : int t @ local shared -> (int -> unit) @ localApply bitwise-xor of the given value to the subatomic.
logxor performs a non-atomic update on an uncontended subatomic.logxor [@synchro atomic] and Shared.logxor perform an atomic update on a shared subatomic.val incr : int t @ local shared -> unitIncrement a subatomic by 1.
incr performs a non-atomic update on an uncontended subatomic.incr [@synchro atomic] and Shared.incr perform an atomic update on a shared subatomic.val decr : int t @ local shared -> unitDecrement a subatomic by 1.
decr performs a non-atomic update on an uncontended subatomic.decr [@synchro atomic] and Shared.decr perform an atomic update on a shared subatomic.