Module Luv.Once

Once-only initialization.

See Once-only initialization in libuv.

type t

Binds uv_once_t.

val init : unit -> (tError.t) Result.result

Allocates and initializes a once-only barrier.

Binds UV_ONCE_INIT. See pthread_once(3p).

val once : t -> (unit -> unit) -> unit

Guards the given callback to be called only once.

Binds uv_once. See pthread_once(3p).

val once_c : t -> nativeint -> unit

Like Luv.Once.once, but takes a pointer to a C function.