summaryrefslogtreecommitdiff
path: root/server/src/ForkLabeled.hs
blob: 50b5d76c41ca5210932be811389ad6ceef138ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE CPP #-}
module ForkLabeled where

#ifdef THREAD_DEBUG
import Control.Concurrent.Lifted.Instrument
#else
import Control.Concurrent.Lifted
import GHC.Conc                  (labelThread,forkIO)
#endif

forkLabeled :: String -> IO () -> IO ThreadId
forkLabeled s io = do
    t <- forkIO io
    labelThread t s
    return t