Module Await_capsule.Rwlock

type 'k t = 'k Await_sync.Rwlock.t
type packed =
  1. | P : 'k t -> packed
val 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.

val with_write : 'k 'a 'b. Await_kernel.Await.t @ local -> ('k t -> (f: ('k Portable_kernel.Capsule.Access.t -> 'a @ portable contended) @ local once portable -> 'a @ portable contended) @ local) @ local
val with_read : 'k 'a 'b. Await_kernel.Await.t @ local -> ('k t -> (f: ('k Portable_kernel.Capsule.Access.t @ shared -> 'a @ portable contended) @ local once portable -> 'a @ portable contended) @ local) @ local