HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletime-manager-0.2.3Haskell2010

System.ThreadManager

A thread manager including a time manager. The manager has responsibility to kill managed threads.

  • 4 types
  • 12 values
datadata ThreadManager
#

Manager to manage the thread and the timer.

Starting a thread manager. Its action is initially set to 'return ()' and should be set by setAction. This allows that the action can include the manager itself.

valuestopAfter :: ThreadManager -> IO a -> (Maybe SomeException -> IO ()) -> IO a
#

Stopping the manager.

The action is run in the scope of an exception handler that catches all exceptions (including asynchronous ones); this allows the cleanup handler to cleanup in all circumstances. If an exception is caught, it is rethrown after the cleanup is complete.

Fork

5 declarations
valueforkManaged
  1. :: ThreadManager
  2. -> String

    Thread name

  3. -> IO ()

    Action

  4. -> IO ()
#

Fork a managed thread.

This guarantees that the thread ID is added to the manager's queue before the thread starts, and is removed again when the thread terminates (normally or abnormally).

Synchronization

1 declaration

Re-exports

6 declarations
datadata Handle
#

A handle used by a timeout manager.