summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2015-10-28 13:11:29 -0400
committerJoey Hess2015-10-28 13:11:29 -0400
commit0372aa05acdf281e27402446e8cdb731a78a848e (patch)
treefbd6263f333d1af80e6aa49052897db9648c0036
parentc81c5a798aa0b8877369b7f2209945d446a94eb6 (diff)
propellor spin
-rw-r--r--src/Utility/ConcurrentOutput.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Utility/ConcurrentOutput.hs b/src/Utility/ConcurrentOutput.hs
index a3cc54d2..71055f14 100644
--- a/src/Utility/ConcurrentOutput.hs
+++ b/src/Utility/ConcurrentOutput.hs
@@ -74,16 +74,27 @@ takeOutputLock' block = do
lcker <- outputLockedBy <$> getOutputHandle
v' <- tryTakeMVar lcker
case v' of
- Just orig@(ProcessLock h _) ->
+ Just orig@(ProcessLock h _) -> do
+ hPutStrLn stderr $ show ("CHECK STALE")
+ hFlush stderr
-- if process has exited, lock is stale
ifM (isJust <$> P.getProcessExitCode h)
- ( havelock
+ ( do
+ hPutStrLn stderr $ show ("WAS STALE")
+ hFlush stderr
+ havelock
, if block
then do
+ hPutStrLn stderr $ show ("WAIT FOR PROCESS")
+ hFlush stderr
void $ P.waitForProcess h
havelock
else do
+ hPutStrLn stderr $ show ("RESTORE")
+ hFlush stderr
putMVar lcker orig
+ hPutStrLn stderr $ show ("RESTORE DONE")
+ hFlush stderr
return False
)
Just GeneralLock -> do