Await_capsule.With_rwlockAn 'a Capsule.With_rwlock.t is a value of type 'a in its own capsule, protected by a reader-writer lock
create f runs f within a fresh capsule, and creates a Capsule.With_rwlock.t containing the result
val of_isolated : 'a Portable_kernel.Capsule.Isolated.t @ unique -> 'a tof_isolated isolated creates a Capsule.With_rwlock.t from a value in an isolated capsule, consuming the isolated capsule.
val with_write :
'a 'b. Await_kernel.Await.t @ local ->
('a t ->
(f:('a -> 'b @ portable contended) @ local once portable ->
'b @ portable contended) @ local) @ localwith_write t ~f locks the reader-writer lock associated with t for writing and calls f on the protected value, returning the result.
val with_read :
'a 'b. Await_kernel.Await.t @ local ->
('a t ->
(f:('a @ shared -> 'b @ portable contended) @ local once portable ->
'b @ portable contended) @ local) @ localwith_read t ~f locks the reader-writer lock associated with t for reading and calls f on the protected value, returning the result.
val iter_write :
Await_kernel.Await.t @ local ->
('a t ->
(f:('a -> Base.unit) @ local once portable ->
Base.unit) @ local) @ localiter_write t ~f is with_write t ~f, specialised to a function that returns unit
val iter_read :
'a. Await_kernel.Await.t @ local ->
('a t ->
(f:('a @ shared -> Base.unit) @ local once portable ->
Base.unit) @ local) @ localiter_read t ~f is with_read t ~f, specialised to a function that returns unit