diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-11-12 16:35:15 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-11-12 16:35:15 -0400 |
commit | d94a72a381baf0e251db48844d27755d5f2c8f14 (patch) | |
tree | bb12b4ac1036db0f79d09d234490180b66288db0 /Utility | |
parent | 0356f1b6e6d5905430e57eedf868095d13610b4c (diff) |
refactor
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/LockPool/LockHandle.hs | 8 | ||||
-rw-r--r-- | Utility/LockPool/PidLock.hs | 3 | ||||
-rw-r--r-- | Utility/LockPool/Posix.hs | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Utility/LockPool/LockHandle.hs b/Utility/LockPool/LockHandle.hs index 1fa8e7ca7..ec36e6156 100644 --- a/Utility/LockPool/LockHandle.hs +++ b/Utility/LockPool/LockHandle.hs @@ -10,6 +10,7 @@ module Utility.LockPool.LockHandle where import qualified Utility.LockPool.STM as P +import Utility.LockPool.STM (LockFile) import Control.Concurrent.STM import Control.Exception @@ -22,13 +23,18 @@ data LockHandle = LockHandle data FileLockOps = FileLockOps { fDropLock :: IO () #ifndef mingw32_HOST_OS - , fCheckSaneLock :: FilePath -> IO Bool + , fCheckSaneLock :: LockFile -> IO Bool #endif } dropLock :: LockHandle -> IO () dropLock h = P.releaseLock (poolHandle h) (fDropLock (fileLockOps h)) +#ifndef mingw32_HOST_OS +checkSaneLock :: LockFile -> LockHandle -> IO Bool +checkSaneLock lockfile (LockHandle _ flo) = fCheckSaneLock flo lockfile +#endif + -- Take a lock, by first updating the lock pool, and then taking the file -- lock. If taking the file lock fails for any reason, take care to -- release the lock in the lock pool. diff --git a/Utility/LockPool/PidLock.hs b/Utility/LockPool/PidLock.hs index 3d90e4b42..dc796b961 100644 --- a/Utility/LockPool/PidLock.hs +++ b/Utility/LockPool/PidLock.hs @@ -53,9 +53,6 @@ getLockStatus file = P.getLockStatus P.lockPool file (StatusLockedBy <$> getProcessID) (F.getLockStatus file) -checkSaneLock :: LockFile -> LockHandle -> IO Bool -checkSaneLock lockfile (LockHandle _ flo) = fCheckSaneLock flo lockfile - mk :: F.LockHandle -> FileLockOps mk h = FileLockOps { fDropLock = F.dropLock h diff --git a/Utility/LockPool/Posix.hs b/Utility/LockPool/Posix.hs index eb679b7e8..a77ed8f01 100644 --- a/Utility/LockPool/Posix.hs +++ b/Utility/LockPool/Posix.hs @@ -67,9 +67,6 @@ getLockStatus file = P.getLockStatus P.lockPool file (StatusLockedBy <$> getProcessID) (F.getLockStatus file) -checkSaneLock :: LockFile -> LockHandle -> IO Bool -checkSaneLock lockfile (LockHandle _ flo) = fCheckSaneLock flo lockfile - mk :: F.LockHandle -> FileLockOps mk h = FileLockOps { fDropLock = F.dropLock h |