diff options
author | James Crayne <jim.crayne@gmail.com> | 2019-10-18 09:01:03 +0000 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-01 19:50:02 -0500 |
commit | b3795514a956753b1b58a3709ce08e32d906b742 (patch) | |
tree | f554bafe905663e87250e084c36b5bc15f3f9dee /lifted-concurrent | |
parent | 9273a01aac621f09b0c00292b55153d558b4a4e0 (diff) |
forkLabeled
Diffstat (limited to 'lifted-concurrent')
-rw-r--r-- | lifted-concurrent/lifted-concurrent.cabal | 2 | ||||
-rw-r--r-- | lifted-concurrent/src/Control/Concurrent/Lifted/Instrument.hs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lifted-concurrent/lifted-concurrent.cabal b/lifted-concurrent/lifted-concurrent.cabal index 3d8acba7..ca32b4a5 100644 --- a/lifted-concurrent/lifted-concurrent.cabal +++ b/lifted-concurrent/lifted-concurrent.cabal | |||
@@ -2,7 +2,7 @@ | |||
2 | -- documentation, see http://haskell.org/cabal/users-guide/ | 2 | -- documentation, see http://haskell.org/cabal/users-guide/ |
3 | 3 | ||
4 | name: lifted-concurrent | 4 | name: lifted-concurrent |
5 | version: 0.1.0.0 | 5 | version: 0.1.1.0 |
6 | -- synopsis: | 6 | -- synopsis: |
7 | -- description: | 7 | -- description: |
8 | license: BSD3 | 8 | license: BSD3 |
diff --git a/lifted-concurrent/src/Control/Concurrent/Lifted/Instrument.hs b/lifted-concurrent/src/Control/Concurrent/Lifted/Instrument.hs index fc3b6369..eeda4de8 100644 --- a/lifted-concurrent/src/Control/Concurrent/Lifted/Instrument.hs +++ b/lifted-concurrent/src/Control/Concurrent/Lifted/Instrument.hs | |||
@@ -1,6 +1,7 @@ | |||
1 | {-# LANGUAGE FlexibleContexts #-} | 1 | {-# LANGUAGE FlexibleContexts #-} |
2 | module Control.Concurrent.Lifted.Instrument | 2 | module Control.Concurrent.Lifted.Instrument |
3 | ( module Control.Concurrent.Lifted | 3 | ( module Control.Concurrent.Lifted |
4 | , forkLabeled | ||
4 | , forkIO | 5 | , forkIO |
5 | , forkOS | 6 | , forkOS |
6 | , fork | 7 | , fork |
@@ -42,6 +43,12 @@ globals = unsafePerformIO $ newMVar $ GlobalState | |||
42 | } | 43 | } |
43 | {-# NOINLINE globals #-} | 44 | {-# NOINLINE globals #-} |
44 | 45 | ||
46 | forkLabeled :: String -> IO () -> IO ThreadId | ||
47 | forkLabeled lbl action = do | ||
48 | t <- forkIO action | ||
49 | labelThread t lbl | ||
50 | return t | ||
51 | {-# INLINE forkLabeled #-} | ||
45 | 52 | ||
46 | forkIO :: IO () -> IO ThreadId | 53 | forkIO :: IO () -> IO ThreadId |
47 | forkIO = instrumented GHC.forkIO | 54 | forkIO = instrumented GHC.forkIO |