package core_unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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.

type t
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 than EEXIST.

val unlock_exn : t -> unit

Raises an exception if the rmdir system call fails.