summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/IO/Handle/Lock/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/IO/Handle/Lock/Common.hs')
-rw-r--r--libraries/base/GHC/IO/Handle/Lock/Common.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/libraries/base/GHC/IO/Handle/Lock/Common.hs b/libraries/base/GHC/IO/Handle/Lock/Common.hs
new file mode 100644
index 0000000000..b85e0916ab
--- /dev/null
+++ b/libraries/base/GHC/IO/Handle/Lock/Common.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+-- | Things common to all file locking implementations.
+module GHC.IO.Handle.Lock.Common
+ ( FileLockingNotSupported(..)
+ , LockMode(..)
+ ) where
+
+import GHC.Exception
+import GHC.Show
+
+-- | Exception thrown by 'hLock' on non-Windows platforms that don't support
+-- 'flock'.
+data FileLockingNotSupported = FileLockingNotSupported
+ deriving Show -- ^ @since 4.10.0.0
+
+-- ^ @since 4.10.0.0
+instance Exception FileLockingNotSupported
+
+-- | Indicates a mode in which a file should be locked.
+data LockMode = SharedLock | ExclusiveLock