From: simonmar Date: Tue, 22 Oct 2002 10:59:40 +0000 (+0000) Subject: [project @ 2002-10-22 10:59:40 by simonmar] X-Git-Tag: nhc98-1-18-release~809 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=69a85c4250b8a3ae981e1ebc6b66c147f1883a9a;p=ghc-base.git [project @ 2002-10-22 10:59:40 by simonmar] Don't bogusly cast ThreadId# to Ptr (). The right way to fix these warnings is to change the type signatures of cmp_thread and rts_getThreadId to take StgPtr rather than StgTSO *, since the compiler now has no internal distinction between the two in the backend (it used to, but recent simplifications removed the distinction). --- diff --git a/Control/Concurrent.hs b/Control/Concurrent.hs index 968e303..a9fd3f6 100644 --- a/Control/Concurrent.hs +++ b/Control/Concurrent.hs @@ -81,7 +81,6 @@ import GHC.TopHandler ( reportStackOverflow, reportError ) import GHC.IOBase ( IO(..) ) import GHC.IOBase ( unsafeInterleaveIO ) import GHC.Base -import GHC.Ptr #endif #ifdef __HUGS__ @@ -148,12 +147,10 @@ functions blocks only the thread making the call. -- cmp_thread in the RTS. #ifdef __GLASGOW_HASKELL__ -type StgTSO = Ptr () +id2TSO :: ThreadId -> ThreadId# +id2TSO (ThreadId t) = t -id2TSO :: ThreadId -> StgTSO -id2TSO (ThreadId t) = unsafeCoerce# t - -foreign import ccall unsafe "cmp_thread" cmp_thread :: StgTSO -> StgTSO -> Int +foreign import ccall unsafe "cmp_thread" cmp_thread :: ThreadId# -> ThreadId# -> Int -- Returns -1, 0, 1 cmpThread :: ThreadId -> ThreadId -> Ordering @@ -172,7 +169,7 @@ instance Eq ThreadId where instance Ord ThreadId where compare = cmpThread -foreign import ccall unsafe "rts_getThreadId" getThreadId :: StgTSO -> Int +foreign import ccall unsafe "rts_getThreadId" getThreadId :: ThreadId# -> Int instance Show ThreadId where showsPrec d t =