X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FException.h;h=251a957c9f963e78652d5bfa283c16cc15c00940;hb=e5beb5fa8e010e49a6fe470a4a4e9ad8dbfd71f0;hp=07203f9428f6c88914d18ba697a53ab7dc61223d;hpb=e1dc924bbb4efde0128e9dbeafa7580daada2706;p=ghc-hetmet.git diff --git a/ghc/rts/Exception.h b/ghc/rts/Exception.h index 07203f9..251a957 100644 --- a/ghc/rts/Exception.h +++ b/ghc/rts/Exception.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Exception.h,v 1.1 1999/12/01 14:34:38 simonmar Exp $ + * $Id: Exception.h,v 1.2 2000/03/17 10:24:44 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -9,3 +9,22 @@ extern const StgInfoTable blockAsyncExceptionszh_ret_info; extern const StgInfoTable 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. + */ +static __inline__ int +interruptible(StgTSO *t) +{ + switch (t->why_blocked) { + case BlockedOnMVar: + case BlockedOnException: + case BlockedOnRead: + case BlockedOnWrite: + case BlockedOnDelay: + return 1; + default: + return 0; + } +}