--- a/src/Tools/Haskell/Haskell.thy Fri Dec 21 16:08:39 2018 +0100
+++ b/src/Tools/Haskell/Haskell.thy Fri Dec 21 16:22:11 2018 +0100
@@ -1691,7 +1691,8 @@
ThreadId, Result,
find_id,
properties, change_properties,
- stop, is_stopped,
+ is_stopped, stop,
+ my_uuid, stop_uuid,
Fork, fork_finally, fork)
where
@@ -1700,6 +1701,7 @@
import System.IO.Unsafe
import qualified Data.List as List
+import Control.Monad (forM_)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Control.Exception.Base (SomeException)
@@ -1779,6 +1781,17 @@
stop id = map_info id (\info -> info {stopped = True})
+{- UUID -}
+
+my_uuid :: IO UUID.T
+my_uuid = uuid <$> my_info
+
+stop_uuid :: UUID.T -> IO ()
+stop_uuid uuid = do
+ id <- find_id uuid
+ forM_ id stop
+
+
{- fork -}
type Fork a = (ThreadId, UUID.T, IO (Result a))