We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2843f3a commit 8bc627fCopy full SHA for 8bc627f
cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/Main.hs
@@ -4,11 +4,13 @@ import qualified System.Posix.Signals as Signal
4
import System.Exit (exitFailure)
5
6
main = do
7
+ writeFile "exe.run" "up and running"
8
mainThreadId <- myThreadId
9
Signal.installHandler Signal.sigTERM (Signal.Catch $ killThread mainThreadId) Nothing
- do
10
- putStrLn "about to sleep"
11
- writeFile "exe.run" "up and running"
12
- threadDelay 10000000 -- 10s
13
- putStrLn "done sleeping"
14
- `finally` putStrLn "exiting"
+ sleep
+ `finally` putStrLn "exiting"
+ where
+ sleep = do
+ putStrLn "about to sleep"
15
+ threadDelay 10000000 -- 10s
16
+ putStrLn "done sleeping"
0 commit comments