úÎYÂWq     A  ±7 is an abstract type representing a handle to a thread 8that is executing or has executed a computation of type IO ±. Extract the native  Control.Concurrent.. The Show/ instance lets you convert an arbitrary-valued  to string form; showing a 0 value is occasionally useful when debugging or 2diagnosing the behaviour of a concurrent program. The Ord6 instance implements an arbitrary total ordering over s. XBas van Dijk <v.dijk.bas@gmail.com> , Roel van Dijk <vandijk.roel@gmail.com> )Sparks off a new thread to run the given  computation and returns the  of the newly created thread. JThe new thread will be a lightweight thread; if you want to use a foreign ,library that uses thread-local storage, use  instead. GGHC note: the new thread inherits the blocked state of the parent (see ). Like 0, this sparks off a new thread to run the given  computation and returns the  of the newly created thread. Unlike ,  creates a bound# thread, which is necessary if you Kneed to call foreign (non-Haskell) libraries that make use of thread-local state, such as OpenGL (see Control.Concurrent). Using  instead of . makes no difference at all to the scheduling Obehaviour of the Haskell runtime system. It is a common misconception that you  need to use  instead of # to avoid blocking all the Haskell ,threads when making a foreign call; this isn'#t the case. To allow foreign calls Kto be made without blocking all the Haskell threads (with GHC), it is only necessary to use the  -threaded/ option when linking your program, and to make &sure the foreign import is not marked unsafe. +Internally used function which generalises  and . Parametrised /by the function which does the actual forking. ,Block until the given thread is terminated.  Returns   x0 if the thread terminated normally and returned x.  Returns ! e if some exception e" was thrown in the thread and wasn't caught. Like 3 but will ignore the value returned by the thread. Like > but will either rethrow the exception that was thrown in the = thread or return the value that was returned by the thread. Like : in that it will rethrow the exception that was thrown in A the thread but it will ignore the value returned by the thread. A non-blocking .  Returns "! if the thread is still running.  Returns # (  x)0 if the thread terminated normally and returned x.  Returns # (! e) if some exception e was thrown in the thread and wasn' t caught. ;Notice that this observation is only a snapshot of a thread's state. By the time >a program reacts on its result it may already be out of date. Returns $( if the thread is currently running and % otherwise. ;Notice that this observation is only a snapshot of a thread's state. By the time >a program reacts on its result it may already be out of date.  @ raises an arbitrary exception in the target thread (GHC only).  C does not return until the exception has been raised in the target Jthread. The calling thread can thus be certain that the target thread has Qreceived the exception. This is a useful property to know when dealing with race Iconditions: eg. if there are two threads that can kill each other, it is Dguaranteed that only one of the threads will get to kill the other. QIf the target thread is currently making a foreign call, then the exception will not be raised (and hence  % will not return) until the call has Gcompleted. This is the case regardless of whether the call is inside a  or not. !Important note: the behaviour of  $ differs from that described in the paper ""Asynchronous exceptions in Haskell" ( =http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm). In the paper,  ? is non-blocking; but the library implementation adopts a more synchronous design in which  ( does not return until the exception is Nreceived by the target thread. The trade-off is discussed in Section 9 of the $paper. Like any blocking operation,  ! is therefore interruptible (see Section 5.3 of the paper). @There is currently no guarantee that the exception delivered by   will Lbe delivered at the first possible opportunity. In particular, a thread may & and then re-( exceptions without receiving a pending  *. This is arguably undesirable behaviour.  B terminates the given thread (GHC only). Any work already done by the thread isn'?t lost: the computation is suspended until required by another Ithread. The memory used by the thread will be garbage collected if it isn't referenced from anywhere. The  ! function is defined in terms of  . *Note that this function is different than Control.Concurrent.' in 6that it blocks until the target thread is terminated: killThread tid =   tid ( )  tid    XBas van Dijk <v.dijk.bas@gmail.com> , Roel van Dijk <vandijk.roel@gmail.com> * Create a new empty group. Same as Control.Concurrent.Thread. but additionaly adds  the thread to the group. Same as Control.Concurrent.Thread. but additionaly adds  the thread to the group. +,JBlock until all threads, that were added to the group before calling this  function, have terminated. Returns $3 if any thread in the group is running and returns %  otherwise. :Notice that this observation is only a snapshot of a group's state. By the time >a program reacts on its result it may already be out of date.    -       !"#$%&%'()(*+,+-"./012$34 threads-0.1Control.Concurrent.ThreadControl.Concurrent.Thread.Group"Control.Concurrent.Thread.InternalUtilsThreadIdthreadIdforkIOforkOSwaitwait_ unsafeWait unsafeWait_status isRunningthrowTo killThread ThreadGroupnew isAnyRunningresultbaseGHC.Conc$fShowThreadId $fOrdThreadId<$$>voidifMwhenThen throwInnertryReadghc-prim GHC.TypesIOGHC.IOblockfork Data.EitherRightLeft Data.MaybeNothingJustGHC.BoolTrueFalseunblockGHC.IO.Exception ThreadKilledGHC.Base>>lock