Module Blocked.Value

Blocked with a value.

This is the same API as Action.Blocked but for when you already know (and usually store) the value to synchronize with. Typically used for waiting actions tag synchronize with a user provided tag. For example Fun.Async.wait_cancelled, Port.offer', etc.

type 'a blocked := 'a t
type t =
  1. | V : 'a Result.t * 'a blocked -> t
    (*

    The value to resume with and the blocked invocation.

    *)
val make : 'a -> 'a blocked -> t

make v b is V (Action.Result.Value v, b).

val exchange_waiting_to_synced : t -> state

exchange_waiting_to_synced (V (_, b)) is exchange_waiting_to_synced b.

val exchange_waiting_to_claimed : t -> state

exchange_waiting_to_claimed (V (_, b)) is exchange_waiting_to_claimed b.

val set_state : t -> state -> unit

set_state (V (_, b) is set_state b s.

val is_synced : t -> bool

is_synced (V (_, b) is is_synced b.

val is_not_synced : t -> bool

is_not_synced (V (_, b) is is_not_synced b.

val is_not : t -> 'b blocked -> bool

is_not (V (_, b0)) b1 is is_not b0 b1.

val tricky_unblock : t -> unit

tricky_unblock (V (v, b) is tricky_unblock b v.

val synced_unblock : t -> unit

synced_unblock (V (v, b)) is synced_unblock ~candidate:v b.

val synced_unblock_is_ours : t -> bool

synced_unblock_is_ours (V (v, b)) is synced_unblock_is_ours ~candidate:v b.