From: stolz Date: Fri, 30 Aug 2002 12:25:15 +0000 (+0000) Subject: [project @ 2002-08-30 12:25:15 by stolz] X-Git-Tag: nhc98-1-18-release~890 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c5c19001cb060d8dc966736209bb1c153060f924;p=ghc-base.git [project @ 2002-08-30 12:25:15 by stolz] Express 'killThread' in terms of 'throwTo' --- diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index 3c994f3..49689a3 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -90,14 +90,14 @@ This misfeature will hopefully be corrected at a later date. not implemented in Hugs). Any work already done by the thread isn\'t lost: the computation is suspended until required by another thread. The memory used by the thread will be garbage collected if it isn\'t -referenced from anywhere. The 'killThread' function may be defined in +referenced from anywhere. The 'killThread' function is defined in terms of 'throwTo': -> killThread tid = throwTo tid (AsyncException ThreadKilled) +> killThread tid = throwTo tid (AsyncException ThreadKilled) + -} killThread :: ThreadId -> IO () -killThread (ThreadId id) = IO $ \ s -> - case (killThread# id (AsyncException ThreadKilled) s) of s1 -> (# s1, () #) +killThread tid = throwTo tid (AsyncException ThreadKilled) {- | 'throwTo' raises an arbitrary exception in the target thread.