Pidlock.with_pidlock: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/daemon/pidlock.bend as Pidlock Lines 75-81 of cswap-bend-cli@0.1.0.0/daemon/pidlock.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/daemon/pidlock.bend&start_line=75&end_line=81 import Base import cswap-bend-cli@0.1.0.0/fs/write.bend as FsW import cswap-bend-cli@0.1.0.0/act.bend as Act import cswap-bend-cli@0.1.0.0/lock.bend as Lock # Run `act` as the one decider of this state dir. A second caller gets # Fail{(11, "Another `cswap auto` is already running ...")} and `act` never starts. def with_pidlock(-A: Type, +state_dir: String, act: Act.of(A)) -> Act.of(A): do ActM: FsW.mkdir_p(state_dir) m : Maybe<&1, File> <- Lock.acquire(lock_path(state_dir), 0) held(A, state_dir, m, act) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=of https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/daemon/pidlock.bend&name=ActM https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/daemon/pidlock.bend&name=ActM.bind https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/daemon/pidlock.bend&name=held https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/daemon/pidlock.bend&name=lock_path https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fs/write.bend&name=mkdir_p https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&name=acquire