summaryrefslogtreecommitdiff
path: root/Utility/ThreadScheduler.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-04 17:24:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-04 17:25:41 -0400
commite126dc1ab2de836b1036242256f83336cb80ec9d (patch)
tree31f737041730973af0ec803fcb9994b3518d6c0f /Utility/ThreadScheduler.hs
parentf7e1ff6082094e3b1e94f8df3d62ede9ac8e8172 (diff)
avoid blocked indefinitely on mvar on windows
by repeatedly reading lines and pausing since cannot do signal foo used on unix
Diffstat (limited to 'Utility/ThreadScheduler.hs')
-rw-r--r--Utility/ThreadScheduler.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Utility/ThreadScheduler.hs b/Utility/ThreadScheduler.hs
index c3e871cde..dbb6cb317 100644
--- a/Utility/ThreadScheduler.hs
+++ b/Utility/ThreadScheduler.hs
@@ -53,8 +53,11 @@ unboundDelay time = do
{- Pauses the main thread, letting children run until program termination. -}
waitForTermination :: IO ()
waitForTermination = do
+#ifdef mingw32_HOST_OS
+ runEvery (Seconds 600) $
+ void getLine
+#else
lock <- newEmptyMVar
-#ifndef mingw32_HOST_OS
let check sig = void $
installHandler sig (CatchOnce $ putMVar lock ()) Nothing
check softwareTermination
@@ -62,8 +65,8 @@ waitForTermination = do
whenM (queryTerminal stdInput) $
check keyboardSignal
#endif
-#endif
takeMVar lock
+#endif
oneSecond :: Microseconds
oneSecond = 1000000