diff options
-rw-r--r-- | Utility/ThreadScheduler.hs | 10 |
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 |