Module Parallel_capsule.RwlockSource

Sourceval with_write : 'k 'a ('b : value_or_null). Parallel_kernel.t @ local -> 'k t -> f: (Parallel_kernel.t @ local -> ('k Await.Capsule.Access.t -> 'a @ portable contended) @ local once) @ local once portable unyielding -> 'a @ portable contended

with_write parallel t ~f acquires t for writing, runs f within the associated capsule with access to parallel for doing parallel work, then releases t.

  • raises Poisoned

    if t cannot be acquired because it is poisoned.

  • raises Frozen

    if t cannot be acquired for writing because it is frozen.

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

with_read parallel t ~f acquires t for reading, runs f within the associated capsule with access to parallel for doing parallel work, then releases t.

  • raises Poisoned

    if t cannot be acquired because it is poisoned.

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

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

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

with_read_or_cancel parallel c t ~f is Completed (with_read parallel 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.

Sourcemodule Expert : sig ... end

Versions of the functions in Capsule.Sync.Rwlock.Expert which take a Parallel_kernel.t instead of an Await.t.