package saturn_lockfree

  1. Overview
  2. Docs

Source file michael_scott_queue_unsafe_node.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Atomic = Multicore_magic.Transparent_atomic

type ('a, _) t =
  | Nil : ('a, [> `Nil ]) t
  | Next : {
      mutable next : ('a, [ `Nil | `Next ]) t;
      mutable value : 'a;
    }
      -> ('a, [> `Next ]) t

let[@inline] make value = Next { next = Nil; value }

external as_atomic : ('a, [ `Next ]) t -> ('a, [ `Nil | `Next ]) t Atomic.t
  = "%identity"
OCaml

Innovation. Community. Security.