more fixes to windows build for content retention files
Will probably build successfully now. Still untested.
This commit is contained in:
parent
647bff9770
commit
be8e1ab512
1 changed files with 16 additions and 12 deletions
|
@ -164,31 +164,33 @@ lockContentShared key mduration a = do
|
||||||
, Nothing
|
, Nothing
|
||||||
)
|
)
|
||||||
#else
|
#else
|
||||||
lock retention v =
|
lock retention obj lckf =
|
||||||
let (locker, postunlock) = winLocker lockShared v
|
let (locker, postunlock) = winLocker lockShared' obj lckf
|
||||||
in
|
in
|
||||||
( locker >>= \case
|
( locker >>= \case
|
||||||
Just lck -> do
|
Just lck -> do
|
||||||
writeretention retention
|
writeretention retention
|
||||||
return (Just lck)
|
return (Just lck)
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
, \lckfile -> do
|
, Just $ \lckfile -> do
|
||||||
maybe noop (\a -> a lckfile) postunlock
|
maybe noop (\pu -> pu lckfile) postunlock
|
||||||
lockdropretention v retention
|
lockdropretention obj lckf retention
|
||||||
)
|
)
|
||||||
|
|
||||||
lockdropretention _ Nothing = noop
|
lockdropretention _ _ Nothing = noop
|
||||||
lockdropretention v retention@(Just _) = do
|
lockdropretention obj lckf retention = do
|
||||||
-- In order to dropretention, have to
|
-- In order to dropretention, have to
|
||||||
-- take an exclusive lock.
|
-- take an exclusive lock.
|
||||||
let (exlocker, expostunlock) =
|
let (exlocker, expostunlock) =
|
||||||
winLocker lockExclusive v
|
winLocker lockExclusive' obj lckf
|
||||||
exlocker >>= \case
|
exlocker >>= \case
|
||||||
Nothing -> noop
|
Nothing -> noop
|
||||||
Just lck -> do
|
Just lck -> do
|
||||||
dropretention retention
|
dropretention retention
|
||||||
liftIO $ dropLock lck
|
liftIO $ dropLock lck
|
||||||
fromMaybe noop expostunlock
|
case (expostunlock, lckf) of
|
||||||
|
(Just pu, Just f) -> pu f
|
||||||
|
_ -> noop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
writeretention Nothing = noop
|
writeretention Nothing = noop
|
||||||
|
@ -238,8 +240,10 @@ lockContentForRemoval key fallback a = lockContentUsing lock key fallback $
|
||||||
(tryLockExclusive Nothing contentfile)
|
(tryLockExclusive Nothing contentfile)
|
||||||
in (lck, Nothing)
|
in (lck, Nothing)
|
||||||
#else
|
#else
|
||||||
lock = checkRetentionTimestamp key
|
lock obj lckf =
|
||||||
(winLocker lockExclusive)
|
let (exlocker, expostunlock) =
|
||||||
|
winLocker lockExclusive' obj lckf
|
||||||
|
in (checkRetentionTimestamp key exlocker, expostunlock)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{- Passed the object content file, and maybe a separate lock file to use,
|
{- Passed the object content file, and maybe a separate lock file to use,
|
||||||
|
@ -362,7 +366,7 @@ lockContentUsing contentlocker key fallback a = withContentLockFile key $ \mlock
|
||||||
case mlockfile of
|
case mlockfile of
|
||||||
Nothing -> noop -- never reached
|
Nothing -> noop -- never reached
|
||||||
Just lockfile -> do
|
Just lockfile -> do
|
||||||
maybe noop (\a -> a lockfile) postunlock
|
maybe noop (\pu -> pu lockfile) postunlock
|
||||||
cleanuplockfile lockfile
|
cleanuplockfile lockfile
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue