Eio_fs_unix.HeldA lock held for as long as its holder says, restated as it goes.
val take :
sw:Eio.Switch.t ->
?block:block ->
?create:create ->
?contents:string ->
?on_wait:(unit -> unit) ->
_ Eio.Path.t ->
tval restate : t -> string -> unitrestate h contents replaces the lock file's contents with contents through the held descriptor, so no reader finds the file unlocked between the writes and the hold is kept. It first takes the record lock again on that descriptor, which restores a hold a close of the file elsewhere in this process dropped.
val release : ?contents:string -> t -> unitrelease ~contents h writes contents, when present, through the held descriptor and lets the lock go, returning once it is free. Releasing a released lock, or one whose switch has ended, does nothing.