Safe HaskellSafe-Infered



Utilities related to livelocks and death detection



type Livelock = FilePathSource

mkLivelockFile :: (Error e, MonadError e m, MonadIO m) => FilePath -> m (Fd, Livelock)Source

Appends the current time to the given prefix, creates the lockfile in the appropriate directory, and locks it. Returns its full path and the file's file descriptor.

listLiveLocks :: IO [FilePath]Source

List currently existing livelocks. Underapproximate if some error occurs.

isDead :: Livelock -> IO BoolSource

Detect whether a the process identified by the given path does not exist any more. This function never fails and only returns True if it has positive knowledge that the process does not exist any more (i.e., if it managed successfully obtain a shared lock on the file).