def with_dirlock
import cswap-bend-cli@0.1.0.0/dirlock.bend as Dirlockimport Base
import cswap-bend-cli@0.1.0.0/act.bend as Act
97# Hold the directory lock around `act`, released whatever `act` answers.
98def with_dirlock(-A: Type, +dir: String, +timeout_ms: U32, +staleness: U32, act: Act.of(A)) -> Act.of(A):
99 do ActM<A>:
100 take(dir, timeout_ms, staleness)
101 Act.finally(A, act, release(dir))