package ocaml-solo5-cross-aarch64

  1. Overview
  2. Docs
OCaml cross-compiler to the freestanding 64-bit ARM Solo5 backend

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.0.1.tar.gz
md5=11ce90fb59f3ddf2ca04d33ce971e247
sha512=a7fbd333154e8892f621000b7c852f6a3dce1aa66d6f2a16e9543cfdb479003f90eb9c02ae5e925edbe6cb4d83ce45e726c55754dfbaee7dc2a51029fb921c25

doc/src/stdlib/atomic.ml.html

Source file atomic.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*                 Stephen Dolan, University of Cambridge                 *)
(*                                                                        *)
(*   Copyright 2017-2018 University of Cambridge.                         *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

type !'a t

external make : 'a -> 'a t = "%makemutable"
external make_contended : 'a -> 'a t = "caml_atomic_make_contended"
external get : 'a t -> 'a = "%atomic_load"
external exchange : 'a t -> 'a -> 'a = "%atomic_exchange"
external compare_and_set : 'a t -> 'a -> 'a -> bool = "%atomic_cas"
external fetch_and_add : int t -> int -> int = "%atomic_fetch_add"
external ignore : 'a -> unit = "%ignore"

let set r x = ignore (exchange r x)
let incr r = ignore (fetch_and_add r 1)
let decr r = ignore (fetch_and_add r (-1))