Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
Thread and process write lock.
Only ever have one Lock
object per lock file per process!
openLock :: Path Abs Dir -> IO Lock Source #
Open the lock file and create a lock object.
This does not acquire the lock.
Only ever have one Lock
object per lock file per process!
closeLock :: Lock -> IO () Source #
Close the lock file.
Does not release the lock.
Blocks if the lock is taken.
withLock :: MonadUnliftIO m => Lock -> m a -> m a Source #
Acquire the lock for the duration of the given action and release after.