Module Lock_file_blocking.Mkdir
This is the dumbest lock imaginable: we mkdir
to lock and rmdir
to unlock. This gives you pretty good mutual exclusion, but it makes you vulnerable to stale locks.
val lock_exn : lock_path:string -> [ `We_took_it of t | `Somebody_else_took_it ]
Raises an exception if the
mkdir
system call fails for any reason other thanEEXIST
.
val unlock_exn : t -> unit
Raises an exception if the
rmdir
system call fails.