Module Luv__Semaphore
Semaphores.
See Semaphores in libuv.
type t
Binds
uv_sem_t
.
val init : int -> (t, Luv.Error.t) Result.result
Allocates and initializes a semaphore.
Binds
uv_sem_init
. Seesem_init(3p)
.
val destroy : t -> unit
Cleans up a semaphore.
Binds
uv_sem_destroy
. Seesem_destroy(3p)
.
val post : t -> unit
Increments a semaphore.
Binds
uv_sem_post
. Seesem_post(3p)
.
val wait : t -> unit
Decrements a semaphore.
Binds
uv_sem_wait
. Seesem_wait(3p)
.
val trywait : t -> (unit, Luv.Error.t) Result.result
Tries to decrement a semaphore without blocking.
Binds
uv_sem_trywait
. Seesem_trywait(3p)
.