X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FException.h;h=083faaf230f5e466ab578364735fc94f9e694b32;hb=0d52a0a134871d317b5f8b53a952c882ce5ae5b6;hp=07203f9428f6c88914d18ba697a53ab7dc61223d;hpb=e1dc924bbb4efde0128e9dbeafa7580daada2706;p=ghc-hetmet.git diff --git a/ghc/rts/Exception.h b/ghc/rts/Exception.h index 07203f9..083faaf 100644 --- a/ghc/rts/Exception.h +++ b/ghc/rts/Exception.h @@ -1,11 +1,35 @@ /* ----------------------------------------------------------------------------- - * $Id: Exception.h,v 1.1 1999/12/01 14:34:38 simonmar Exp $ * - * (c) The GHC Team, 1998-1999 + * (c) The GHC Team, 1998-2000 * * Exception support * * ---------------------------------------------------------------------------*/ -extern const StgInfoTable blockAsyncExceptionszh_ret_info; -extern const StgInfoTable unblockAsyncExceptionszh_ret_info; +extern const StgRetInfoTable stg_blockAsyncExceptionszh_ret_info; +extern const StgRetInfoTable stg_unblockAsyncExceptionszh_ret_info; + +/* Determine whether a thread is interruptible (ie. blocked + * indefinitely). Interruptible threads can be sent an exception with + * killThread# even if they have async exceptions blocked. + */ +INLINE_HEADER int +interruptible(StgTSO *t) +{ + switch (t->why_blocked) { + case BlockedOnMVar: + case BlockedOnException: + case BlockedOnRead: + case BlockedOnWrite: +#if defined(mingw32_TARGET_OS) + case BlockedOnDoProc: +#endif + case BlockedOnDelay: + return 1; + // NB. Threaded blocked on foreign calls (BlockedOnCCall) are + // *not* interruptible. We can't send these threads an exception. + default: + return 0; + } +} +