Await_sync.StackA multi-producer, multi-consumer concurrent stack.
A simple, list-based multi-producer multi-consumer stack which provides both lock-free and blocking operations.
include sig ... endval sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.tcreate () creates and returns a new empty stack.
The optional padded argument specifies whether to pad the data structure to avoid false sharing. See Atomic.make for a longer explanation.
push t a enqueues a at the head of t.
val pop :
Await_kernel.Await.t @ local ->
('a t @ local ->
'a @ portable contended) @ local @@ portablepop await t removes and returns the most-recently-pushed value from the head of t, blocking using await if t is empty.
val pop_or_cancel :
Await_kernel.Await.t @ local ->
(Await_kernel.Cancellation.t @ local ->
('a t @ local ->
'a Await_kernel.Or_canceled.t @ portable contended) @ local) @ local @@ portablepop_or_cancel await c t is Completed (pop await t) if c is not cancelled, otherwise it is Canceled.
val pop_nonblocking :
'a t @ local ->
'a Base.or_null @ portable contended @@ portablepop_nonblocking t removes and returns the most-recently-pushed value from the head of t, or returns Null if the stack is empty.
drain t removes and returns all items from t without blocking, returning a list with the most-recently-enqueued item first.
module For_testing : sig ... end