Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@keizo042
Created October 22, 2017 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keizo042/7617be758aa63ee2a961fefb12b8fcb4 to your computer and use it in GitHub Desktop.
Save keizo042/7617be758aa63ee2a961fefb12b8fcb4 to your computer and use it in GitHub Desktop.
module Main where
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Exception
main :: IO ()
main = run `catch` report
run :: IO ()
run = do
v <- newEmptyMVar
withMVarMasked v $ \v -> do
readMVar v
return ()
report ::BlockedIndefinitelyOnMVar -> IO ()
report e = print "blocked"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment