1 /* ---------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2006
5 * Asynchronous exceptions
7 * --------------------------------------------------------------------------*/
12 #define THROWTO_SUCCESS 0
13 #define THROWTO_BLOCKED 1
17 #include "BeginPrivate.h"
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 MessageThrowTo *throwTo (Capability *cap, // the Capability we hold
35 StgClosure *exception); // the exception closure
37 nat throwToMsg (Capability *cap,
40 int maybePerformBlockedException (Capability *cap, StgTSO *tso);
41 void awakenBlockedExceptionQueue (Capability *cap, StgTSO *tso);
43 /* Determine whether a thread is interruptible (ie. blocked
44 * indefinitely). Interruptible threads can be sent an exception with
45 * killThread# even if they have async exceptions blocked.
48 interruptible(StgTSO *t)
50 switch (t->why_blocked) {
52 case BlockedOnMsgThrowTo:
55 #if defined(mingw32_HOST_OS)
60 // NB. Threaded blocked on foreign calls (BlockedOnCCall) are
61 // *not* interruptible. We can't send these threads an exception.
67 #include "EndPrivate.h"
69 #endif /* CMINUSMINUS */
71 #endif /* RAISEASYNC_H */