X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=GHC%2FConc.lhs;h=49689a3d77dd5e489b0babc015420008cd545c8d;hb=7fcfe821e3900658a8396db15cc6995acea3db65;hp=e5c33339bb833ea3a1d4823877f1d68688d159a9;hpb=2b9dddc9114aa8a5c9c7252e9bba9269a0e65413;p=ghc-base.git diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index e5c3333..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 = throwTo (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.