# HG changeset patch # User wenzelm # Date 1545404919 -3600 # Node ID c34dfa431b898e7e578baa6e893abdc80e89eee6 # Parent 7e44f8e2cc491b62319523bfd9fd1eab8886558a proper cleanup; diff -r 7e44f8e2cc49 -r c34dfa431b89 src/Tools/Haskell/Haskell.thy --- a/src/Tools/Haskell/Haskell.thy Fri Dec 21 16:02:00 2018 +0100 +++ b/src/Tools/Haskell/Haskell.thy Fri Dec 21 16:08:39 2018 +0100 @@ -1748,6 +1748,10 @@ Nothing -> (infos, ()) Just info -> (Map.insert id (f info) infos, ())) +delete_info :: ThreadId -> IO () +delete_info id = + atomicModifyIORef' global_state (\infos -> (Map.delete id infos, ())) + {- thread properties -} @@ -1789,7 +1793,8 @@ (do id <- Concurrent.myThreadId atomicModifyIORef' global_state (init_info id uuid) - restore body) >>= finally)) + restore body) + >>= (\res -> do id <- Concurrent.myThreadId; delete_info id; finally res))) return (id, uuid, result) fork :: IO a -> IO (Fork a)