A simple thread management API inspired by the one in chapter 24 of Real World Haskell.
Intended to be imported qualified (suggestion: TM).
- data ThreadManager
- data ThreadStatus
- make :: IO ThreadManager
- fork :: ThreadManager -> IO () -> IO ThreadId
- forkn :: ThreadManager -> Int -> IO () -> IO [ThreadId]
- getStatus :: ThreadManager -> ThreadId -> IO (Maybe ThreadStatus)
- waitFor :: ThreadManager -> ThreadId -> IO (Maybe ThreadStatus)
- waitForAll :: ThreadManager -> IO ()
Make the given number of managed threads.
Get the status of a managed thread.
Block until a specific managed thread terminates.