Module Luv.Rwlock
Read-write locks.
See Read-write locks in libuv.
type t
Binds
uv_rwlock_t
.
val init : unit -> (t, Error.t) Result.result
Allocates and initializes a read-write lock.
Binds
uv_rwlock_init
. Seepthread_rwlock_init(3p)
.
val destroy : t -> unit
Cleans up a read-write lock.
Binds
uv_rwlock_destroy
. Seepthread_rwlock_destroy(3p)
.
val rdlock : t -> unit
Takes a read-write lock for reading (shared access).
Binds
uv_rwlock_rdlock
. Seepthread_rwlock_rdlock(3p)
.
val tryrdlock : t -> (unit, Error.t) Result.result
Tries to take a read-write lock for reading without blocking.
Binds
uv_rwlock_tryrdlock
. Seepthread_rwlock_tryrdlock(3p)
.
val rdunlock : t -> unit
Releases a read-write lock after it was taken for reading.
Binds
uv_rwlock_rdunlock
. Seepthread_rwlock_unlock(3p)
.
val wrlock : t -> unit
Takes a read-write lock for writing (exclusive access).
Binds
uv_rwlock_wrlock
. Seepthread_rwlock_wrlock(3p)
.
val trywrlock : t -> (unit, Error.t) Result.result
Tries to take a read-write lock for writing without blocking.
val wrunlock : t -> unit
Releases a read-write lock after it was taken for writing.
Binds
uv_rwlock_wrunlock
. Seepthread_rwlock_unlock(3p)
.