1 /* ---------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2006
5 * Asynchronous exceptions
7 * --------------------------------------------------------------------------*/
12 #define THROWTO_SUCCESS 0
13 #define THROWTO_BLOCKED 1
16 void throwToSingleThreaded (Capability *cap,
18 StgClosure *exception);
20 void throwToSingleThreaded_ (Capability *cap,
22 StgClosure *exception,
23 rtsBool stop_at_atomically,
26 void suspendComputation (Capability *cap,
30 nat throwTo (Capability *cap, // the Capability we hold
31 StgTSO *source, // the TSO sending the exception
32 StgTSO *target, // the TSO receiving the exception
33 StgClosure *exception, // the exception closure
34 /*[out]*/ void **out // pass to throwToReleaseTarget()
38 void throwToReleaseTarget (void *tso);
41 int maybePerformBlockedException (Capability *cap, StgTSO *tso);
42 void awakenBlockedExceptionQueue (Capability *cap, StgTSO *tso);
44 /* Determine whether a thread is interruptible (ie. blocked
45 * indefinitely). Interruptible threads can be sent an exception with
46 * killThread# even if they have async exceptions blocked.
49 interruptible(StgTSO *t)
51 switch (t->why_blocked) {
53 case BlockedOnException:
56 #if defined(mingw32_HOST_OS)
61 // NB. Threaded blocked on foreign calls (BlockedOnCCall) are
62 // *not* interruptible. We can't send these threads an exception.
68 #endif /* CMINUSMINUS */
70 #endif /* RAISEASYNC_H */