def lock_file
import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLockimport Base
import mylsm-lsm-store@0.6.0.1/src/DurableError.bend as DurableError
84# Attempts the nonblocking OS lock on the open file.
85def lock_file(file: File, operation: String, path: String) -> IO(Result<&1, &1, DurableError.Error, Lock>):
86 do IO<Result<&1, &1, DurableError.Error, Lock>>:
87 pair : File & Result<&1, &1, U32 & String, Unit> <- DbLock.try_lock(file)
88 lock_result(pair, operation, path)