Rwlock.Shared_guard'k Rwlock.Shared_guard.t represents a reader-writer locked that is locked non-exclusively for reading. It morally contains a Capsule.Key.t @@ aliased, but also has a finalizer that freezes the lock if the guard is garbage collected without being passed to Shared_guard.release.
val with_key :
'a 'k. 'k t @ unique ->
(f:('k Capsule.Key.t -> 'a @ unique once) @ local once ->
'a * 'k t @ unique once) @ oncewith_key guard ~f runs f, providing it an aliased key for 'k, and returns the result of f together with the read guard.
val with_password :
'a 'k. 'k t @ unique ->
(f:('k Capsule.Password.Shared.t @ local -> 'a @ unique) @ local once ->
'a * 'k t @ unique) @ oncewith_password g ~f runs f, providing it a shared password for 'k, and returns the result of f together with the guard.
val access :
'a 'k. 'k t @ unique ->
(f:
('k Capsule.Access.t @ shared -> 'a @ unique once portable contended) @ local once portable ->
'a * 'k t @ unique once portable contended) @ onceaccess g ~f runs f, providing it shared access to the capsule 'k, and returns the result of f together with the guard.
val release : 'k t @ unique -> unitrelease guard releases the read lock
val freeze : 'k t @ unique -> 'k Capsule.Key.tfreeze guard marks the lock protected by the read guard guard as frozen, preventing later attempts to acquire it for writing, and returns an aliased key to the capsule.