From 0f5a7cf8ffe3af9b47ba3b83bccb75d0bbf7e549 Mon Sep 17 00:00:00 2001 From: stolz Date: Wed, 26 Jun 2002 08:18:45 +0000 Subject: [PATCH] [project @ 2002-06-26 08:18:45 by stolz] - Make TSO "stable" again: The thread label was changing the size of the TSO if you were building a debugging-RTS, leading to binary incompatibility. Now we map TSOs to strings using Hash.c. - API change for labelThread: Label arbitrary threads. --- GHC/Conc.lhs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index e79662c..46120c1 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -24,7 +24,7 @@ module GHC.Conc , par -- :: a -> b -> b , pseq -- :: a -> b -> b , yield -- :: IO () - , labelThread -- :: String -> IO () + , labelThread -- :: ThreadId -> String -> IO () , forkProcess -- :: IO Int -- Waiting @@ -123,11 +123,11 @@ yield :: IO () yield = IO $ \s -> case (yield# s) of s1 -> (# s1, () #) -labelThread :: String -> IO () -labelThread str = IO $ \ s -> +labelThread :: ThreadId -> String -> IO () +labelThread (ThreadId t) str = IO $ \ s -> let ps = packCString# str adr = byteArrayContents# ps in - case (labelThread# adr s) of s1 -> (# s1, () #) + case (labelThread# t adr s) of s1 -> (# s1, () #) forkProcess :: IO Int forkProcess = IO $ \s -> case (forkProcess# s) of (# s1, id #) -> (# s1, (I# id) #) -- 1.7.10.4