slave-thread-0.1.0: A solution to ghost threads and silent exceptions

Safe HaskellNone
LanguageHaskell2010

SlaveThread

Synopsis

Documentation

fork :: IO a -> IO ThreadId Source

Fork a slave thread to run a computation on.

forkFinally :: IO a -> IO b -> IO ThreadId Source

Fork a slave thread with a finalizer action to run a computation on. The finalizer gets executed when the thread dies for whatever reason: due to being killed or an uncaught exception, or a normal termination.

Note the order of arguments:

forkFinally finalizer computation