summaryrefslogtreecommitdiff
path: root/tasks/src/Control/Concurrent/Tasks.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-12-13 12:06:06 -0500
committerJoe Crayne <joe@jerkface.net>2020-01-01 23:25:22 -0500
commit5b9374c79de82025bbb0ce47e0a93e6ddc0ece6c (patch)
tree195794aa0b41e0859826e9c7b9b97cd461cf88fd /tasks/src/Control/Concurrent/Tasks.hs
parent7f2fab398bbbb3f02822d5692c1b6dc07039d036 (diff)
Quicker forkTask thread label.
Diffstat (limited to 'tasks/src/Control/Concurrent/Tasks.hs')
-rw-r--r--tasks/src/Control/Concurrent/Tasks.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tasks/src/Control/Concurrent/Tasks.hs b/tasks/src/Control/Concurrent/Tasks.hs
index da2e589e..73c8152e 100644
--- a/tasks/src/Control/Concurrent/Tasks.hs
+++ b/tasks/src/Control/Concurrent/Tasks.hs
@@ -29,10 +29,10 @@ withTaskGroup glabel numslots action = do
29 writeTVar cnt (succ slot) 29 writeTVar cnt (succ slot)
30 t <- readTChan tg 30 t <- readTChan tg
31 return (slot,t) 31 return (slot,t)
32 _ <- fork $ do 32 t <- fork $ do
33 myThreadId >>= flip labelThread (intercalate "." [glabel,show slot,lbl])
34 task `catch` (\(SomeException e) -> return ()) 33 task `catch` (\(SomeException e) -> return ())
35 atomically $ modifyTVar' cnt pred 34 atomically $ modifyTVar' cnt pred
35 labelThread t (intercalate "." [glabel,show slot,lbl])
36 again 36 again
37 action (TaskGroup tg) `onException` killThread thread 37 action (TaskGroup tg) `onException` killThread thread
38 atomically $ do 38 atomically $ do