Remove the duplicate definition of throwTo in Control.Exception
authorIan Lynagh <igloo@earth.li>
Sun, 3 Aug 2008 14:17:03 +0000 (14:17 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 3 Aug 2008 14:17:03 +0000 (14:17 +0000)
It now imports GHC.Conc, so it is no longer necessary

Control/Exception.hs
GHC/Conc.lhs

index 8d5aa2d..e923d90 100644 (file)
@@ -130,7 +130,7 @@ import GHC.List
 import GHC.Show
 import GHC.IOBase as ExceptionBase
 import GHC.Exception hiding ( Exception )
-import GHC.Conc         ( ThreadId(ThreadId) )
+import GHC.Conc
 #endif
 
 #ifdef __HUGS__
@@ -588,10 +588,3 @@ nestedAtomically = toException NestedAtomically
 
 instance Exception Dynamic
 
------
-
--- XXX From GHC.Conc
-throwTo :: Exception e => ThreadId -> e -> IO ()
-throwTo (ThreadId id) ex = IO $ \ s ->
-   case (killThread# id (toException ex) s) of s1 -> (# s1, () #)
-
index d47ba0b..6ae157e 100644 (file)
@@ -263,11 +263,11 @@ The memory used by the thread will be garbage collected if it isn\'t
 referenced from anywhere.  The 'killThread' function is defined in
 terms of 'throwTo':
 
-> killThread tid = throwTo tid (AsyncException ThreadKilled)
+> killThread tid = throwTo tid ThreadKilled
 
 -}
 killThread :: ThreadId -> IO ()
-killThread tid = throwTo tid (toException ThreadKilled)
+killThread tid = throwTo tid ThreadKilled
 
 {- | 'throwTo' raises an arbitrary exception in the target thread (GHC only).
 
@@ -299,10 +299,9 @@ unblock and then re-block exceptions (using 'unblock' and 'block') without recei
 a pending 'throwTo'.  This is arguably undesirable behaviour.
 
  -}
--- XXX This is duplicated in Control.{Old,}Exception
-throwTo :: ThreadId -> SomeException -> IO ()
+throwTo :: Exception e => ThreadId -> e -> IO ()
 throwTo (ThreadId id) ex = IO $ \ s ->
-   case (killThread# id ex s) of s1 -> (# s1, () #)
+   case (killThread# id (toException ex) s) of s1 -> (# s1, () #)
 
 -- | Returns the 'ThreadId' of the calling thread (GHC only).
 myThreadId :: IO ThreadId