ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol

Ouroboros.Consensus.Util.FileLock

Synopsis

# Documentation

data FileLock m Source #

Abstraction for file locks

Constructors

 FileLock FieldslockFile ∷ FilePath → m (m ())Obtain an exclusive lock on the given file.Returns the function to unlock the file.Blocks until the lock is available.We don't guarantee the ability to read/write to a locked file, not even when holding the lock.

Implementation of FileLock for IO, using on System.FileLock.

Locking the file can block in FFI, so not interruptible.

Unlocking the file is not guaranteed to be synchronous. Near instantaneous on Linux, but not synchronous. On Windows, unlocking is even more lazy.