Module Sync.RwlockSource

Sourcetype packed =
  1. | P : 'k t -> packed
Sourceval create : Base.unit -> packed

Creates a reader-writer lock with a fresh existential key type.

Like create. Useful in module definitions, where GADTs cannot be unpacked.

Sourceval with_write : 'k 'a ('b : value_or_null). Await_kernel.Sync.t @ local -> 'k t -> f: (Await_kernel.Sync.t @ local -> ('k Await_capsule__.Import.Capsule.Access.t -> 'a @ portable contended) @ local once) @ local once portable unyielding -> 'a @ portable contended

with_write s t ~f locks t for writing and runs f, providing it access to the capsule. The Sync.t is passed to f to allow further use of synchronization primitives.

Sourceval with_write_or_cancel : 'k 'a ('b : value_or_null). Await_kernel.Sync.t @ local -> Await_kernel.Cancellation.t @ local -> 'k t -> f: (Await_kernel.Sync.t @ local -> ('k Await_capsule__.Import.Capsule.Access.t -> 'a @ portable contended) @ local once) @ local once portable unyielding -> 'a Await_kernel.Or_canceled.t @ portable contended

with_write_or_cancel s c t ~f is Completed (with_write s t ~f) if c is not canceled, otherwise it is Canceled.

Sourceval with_read : 'k 'a ('b : value_or_null). Await_kernel.Sync.t @ local -> 'k t -> f: (Await_kernel.Sync.t @ local -> ('k Await_capsule__.Import.Capsule.Access.t @ shared -> 'a @ portable contended) @ local once) @ local once portable unyielding -> 'a @ portable contended

with_read s t ~f locks t for reading and runs f, providing it shared access to the capsule. The Sync.t is passed to f to allow further use of synchronization primitives.

Sourceval with_read_or_cancel : 'k 'a ('b : value_or_null). Await_kernel.Sync.t @ local -> Await_kernel.Cancellation.t @ local -> 'k t -> f: (Await_kernel.Sync.t @ local -> ('k Await_capsule__.Import.Capsule.Access.t @ shared -> 'a @ portable contended) @ local once) @ local once portable unyielding -> 'a Await_kernel.Or_canceled.t @ portable contended

with_read_or_cancel s c t ~f is Completed (with_read s t ~f) if c is not canceled, otherwise it is Canceled.

Sourcemodule Poisoning : sig ... end

Functions that poison or freeze the lock if the provided callback raises an exception.