diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Control/Concurrent/Lifted/Instrument.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Control/Concurrent/Lifted/Instrument.hs b/src/Control/Concurrent/Lifted/Instrument.hs index 673e77cd..e4582375 100644 --- a/src/Control/Concurrent/Lifted/Instrument.hs +++ b/src/Control/Concurrent/Lifted/Instrument.hs | |||
@@ -1,4 +1,5 @@ | |||
1 | {-# LANGUAGE FlexibleContexts #-} | 1 | {-# LANGUAGE FlexibleContexts #-} |
2 | {-# LANGUAGE Strict #-} | ||
2 | module Control.Concurrent.Lifted.Instrument | 3 | module Control.Concurrent.Lifted.Instrument |
3 | ( module Control.Concurrent.Lifted | 4 | ( module Control.Concurrent.Lifted |
4 | , forkIO | 5 | , forkIO |
@@ -21,13 +22,13 @@ import Data.Time() | |||
21 | import Data.Time.Clock | 22 | import Data.Time.Clock |
22 | 23 | ||
23 | data PerThread = PerThread | 24 | data PerThread = PerThread |
24 | { lbl :: !String | 25 | { lbl :: String |
25 | , startTime :: !UTCTime | 26 | , startTime :: UTCTime |
26 | } | 27 | } |
27 | deriving (Eq,Ord,Show) | 28 | deriving (Eq,Ord,Show) |
28 | 29 | ||
29 | data GlobalState = GlobalState | 30 | data GlobalState = GlobalState |
30 | { threads :: ! ( Map.Map ThreadId PerThread ) | 31 | { threads :: Map.Map ThreadId PerThread |
31 | } | 32 | } |
32 | 33 | ||
33 | globals :: MVar GlobalState | 34 | globals :: MVar GlobalState |
@@ -67,4 +68,4 @@ modifyThreads f = do | |||
67 | g <- takeMVar globals | 68 | g <- takeMVar globals |
68 | let f' st = st { threads = f (threads st) } | 69 | let f' st = st { threads = f (threads st) } |
69 | r = f' g | 70 | r = f' g |
70 | threads r `seq` putMVar globals r | 71 | putMVar globals r |