summaryrefslogtreecommitdiff
path: root/Utility/ThreadScheduler.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-26 11:12:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-26 11:12:34 -0400
commit02a0ac769289940a7f7c344c3e1c794baec0b00d (patch)
tree7b1108532ae29e13ab19eac173b3129b252caf5e /Utility/ThreadScheduler.hs
parentf4b096950a7826b244d21a88ea97ba6c753c2bc8 (diff)
more windows fixes
Diffstat (limited to 'Utility/ThreadScheduler.hs')
-rw-r--r--Utility/ThreadScheduler.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Utility/ThreadScheduler.hs b/Utility/ThreadScheduler.hs
index a7b3f5d8f..ae005d852 100644
--- a/Utility/ThreadScheduler.hs
+++ b/Utility/ThreadScheduler.hs
@@ -13,12 +13,11 @@ module Utility.ThreadScheduler where
import Common
import Control.Concurrent
+#ifndef __WINDOWS__
import System.Posix.Signals
#ifndef __ANDROID__
-#ifndef __WINDOWS__
import System.Posix.Terminal
#endif
-#else
#endif
newtype Seconds = Seconds { fromSeconds :: Int }
@@ -55,17 +54,16 @@ unboundDelay time = do
waitForTermination :: IO ()
waitForTermination = do
lock <- newEmptyMVar
+#ifndef __WINDOWS__
+ let check sig lock = void $
+ installHandler sig (CatchOnce $ putMVar lock ()) Nothing
check softwareTermination lock
#ifndef __ANDROID__
-#ifndef __WINDOWS__
whenM (queryTerminal stdInput) $
check keyboardSignal lock
#endif
#endif
takeMVar lock
- where
- check sig lock = void $
- installHandler sig (CatchOnce $ putMVar lock ()) Nothing
oneSecond :: Microseconds
oneSecond = 1000000