summaryrefslogtreecommitdiff
path: root/lifted-concurrent/src/Control/Concurrent/ThreadUtil.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lifted-concurrent/src/Control/Concurrent/ThreadUtil.hs')
-rw-r--r--lifted-concurrent/src/Control/Concurrent/ThreadUtil.hs31
1 files changed, 31 insertions, 0 deletions
diff --git a/lifted-concurrent/src/Control/Concurrent/ThreadUtil.hs b/lifted-concurrent/src/Control/Concurrent/ThreadUtil.hs
new file mode 100644
index 00000000..a258d933
--- /dev/null
+++ b/lifted-concurrent/src/Control/Concurrent/ThreadUtil.hs
@@ -0,0 +1,31 @@
1{-# LANGUAGE CPP #-}
2module Control.Concurrent.ThreadUtil
3 (
4#ifdef THREAD_DEBUG
5 module Control.Concurrent.Lifted.Instrument
6#else
7 module Control.Control.Lifted
8 , module GHC.Conc
9#endif
10 ) where
11
12#ifdef THREAD_DEBUG
13import Control.Concurrent.Lifted.Instrument
14#else
15import Control.Concurrent.Lifted
16import GHC.Conc (labelThread)
17
18forkLabeled :: String -> IO () -> IO ThreadId
19forkLabeled lbl action = do
20 t <- forkIO action
21 labelThread t lbl
22 return t
23{-# INLINE forkLabeled #-}
24
25forkOSLabeled :: String -> IO () -> IO ThreadId
26forkOSLabeled lbl action = do
27 t <- forkOS action
28 labelThread t lbl
29 return t
30{-# INLINE forkOSLabeled #-}
31#endif