From c5c19001cb060d8dc966736209bb1c153060f924 Mon Sep 17 00:00:00 2001 From: stolz Date: Fri, 30 Aug 2002 12:25:15 +0000 Subject: [PATCH] [project @ 2002-08-30 12:25:15 by stolz] Express 'killThread' in terms of 'throwTo' --- GHC/Conc.lhs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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. -- 1.7.10.4