Module AtomicInt32Array

module AtomicInt32Array: sig .. end
Atomic containers for arrays of int32 values.

type t 
The type of atomic containers for arrays of int32 values.
type index = int32 
The type of array indices.
val make : int32 -> t
Returns a new container holding an array of passed length.

Raises Invalid_argument if passed length is negative.

val add_and_get : t -> index -> int32 -> int32
add_and_get a i d atomically adds d to the value at index i, and returns the new value.

Raises Invalid_argument if passed index is invalid.

val compare_and_set : t -> index -> int32 -> int32 -> bool
compare_and_set a i e u atomically sets the value of a at index i to u if the current value is e. Returns whether the value of a at index i was equal to e.

Raises Invalid_argument if passed index is invalid.

val decrement_and_get : t -> index -> int32
Atomically decrements the value at passed index, and returns the new value.

Raises Invalid_argument if passed index is invalid.

val get : t -> index -> int32
Returns the value at passed index.

Raises Invalid_argument if passed index is invalid.

val get_and_add : t -> index -> int32 -> int32
get_and_add a i d atomically adds d to the value at index i, and returns the previous value.

Raises Invalid_argument if passed index is invalid.

val get_and_decrement : t -> index -> int32
Atomically decrements the value at passed index, and returns the previous value.

Raises Invalid_argument if passed index is invalid.

val get_and_increment : t -> index -> int32
Atomically increments the value at passed index, and returns the previous value.

Raises Invalid_argument if passed index is invalid.

val get_and_set : t -> index -> int32 -> int32
get_and_set a i x atomically sets the value of a at index i to x, and returns the previous value.

Raises Invalid_argument if passed index is invalid.

val increment_and_get : t -> index -> int32
Atomically increments the value at passed index, and returns the new value.

Raises Invalid_argument if passed index is invalid.

val lazy_set : t -> index -> int32 -> unit
lazy_set a i x eventually sets the value of a at index i to x.

Raises Invalid_argument if passed index is invalid.

val length : t -> int32
Returns the length of the array.
val set : t -> index -> int32 -> unit
set a i x sets the value of a at index i to x.

Raises Invalid_argument if passed index is invalid.

val weak_compare_and_set : t -> index -> int32 -> int32 -> bool
Similar to compare_and_set, with a weak semantics: may be faster on some platforms, but does not provide ordering guarantees.

Raises Invalid_argument if passed index is invalid.