1 /* ---------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2006
5 * Asynchronous exceptions
7 * --------------------------------------------------------------------------*/
12 #define THROWTO_SUCCESS 0
13 #define THROWTO_BLOCKED 1
19 void throwToSingleThreaded (Capability *cap,
21 StgClosure *exception);
23 void throwToSingleThreaded_ (Capability *cap,
25 StgClosure *exception,
26 rtsBool stop_at_atomically);
28 void suspendComputation (Capability *cap,
30 StgUpdateFrame *stop_here);
32 nat throwTo (Capability *cap, // the Capability we hold
33 StgTSO *source, // the TSO sending the exception
34 StgTSO *target, // the TSO receiving the exception
35 StgClosure *exception, // the exception closure
36 /*[out]*/ void **out // pass to throwToReleaseTarget()
40 void throwToReleaseTarget (void *tso);
43 int maybePerformBlockedException (Capability *cap, StgTSO *tso);
44 void awakenBlockedExceptionQueue (Capability *cap, StgTSO *tso);
46 /* Determine whether a thread is interruptible (ie. blocked
47 * indefinitely). Interruptible threads can be sent an exception with
48 * killThread# even if they have async exceptions blocked.
51 interruptible(StgTSO *t)
53 switch (t->why_blocked) {
55 case BlockedOnException:
58 #if defined(mingw32_HOST_OS)
63 // NB. Threaded blocked on foreign calls (BlockedOnCCall) are
64 // *not* interruptible. We can't send these threads an exception.
72 #endif /* CMINUSMINUS */
74 #endif /* RAISEASYNC_H */