1 /* ---------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2006
5 * Asynchronous exceptions
7 * --------------------------------------------------------------------------*/
12 #pragma GCC visibility push(hidden)
14 #define THROWTO_SUCCESS 0
15 #define THROWTO_BLOCKED 1
18 void throwToSingleThreaded (Capability *cap,
20 StgClosure *exception);
22 void throwToSingleThreaded_ (Capability *cap,
24 StgClosure *exception,
25 rtsBool stop_at_atomically);
27 void suspendComputation (Capability *cap,
29 StgUpdateFrame *stop_here);
31 nat throwTo (Capability *cap, // the Capability we hold
32 StgTSO *source, // the TSO sending the exception
33 StgTSO *target, // the TSO receiving the exception
34 StgClosure *exception, // the exception closure
35 /*[out]*/ void **out // pass to throwToReleaseTarget()
39 void throwToReleaseTarget (void *tso);
42 int maybePerformBlockedException (Capability *cap, StgTSO *tso);
43 void awakenBlockedExceptionQueue (Capability *cap, StgTSO *tso);
45 /* Determine whether a thread is interruptible (ie. blocked
46 * indefinitely). Interruptible threads can be sent an exception with
47 * killThread# even if they have async exceptions blocked.
50 interruptible(StgTSO *t)
52 switch (t->why_blocked) {
54 case BlockedOnException:
57 #if defined(mingw32_HOST_OS)
62 // NB. Threaded blocked on foreign calls (BlockedOnCCall) are
63 // *not* interruptible. We can't send these threads an exception.
69 #endif /* CMINUSMINUS */
71 #pragma GCC visibility pop
73 #endif /* RAISEASYNC_H */