Ticket #5796: deadlock.hs

File deadlock.hs, 375 bytes (added by lpsmith, 4 years ago)
Line 
1{-# LANGUAGE OverloadedStrings #-}
2
3import Control.Concurrent (threadDelay)
4import Control.Monad      (forever)
5import Data.Configurator
6
7main = do
8  (config,_) <- autoReload autoConfig [Required "deadlock.cfg"]
9  subscribe config "config.*" (\key val -> print (key,val))
10  forever $ do
11     threadDelay (2*10^6)
12     putStrLn "a"
13     threadDelay (2*10^6)
14     putStrLn "b"