From: simonmar Date: Fri, 15 Feb 2002 14:53:32 +0000 (+0000) Subject: [project @ 2002-02-15 14:53:32 by simonmar] X-Git-Tag: Approximately_9120_patches~28 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=adfe39e83768a9ac454149cd1541127cb85bf973;p=ghc-hetmet.git [project @ 2002-02-15 14:53:32 by simonmar] Ensure that async exceptions are blocked during the raising of an async exception - we're about to block them anyway on entry to the handler, but we don't want any further exceptions being raised in the meantime. --- diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index ba6920b..63e06fa 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1,5 +1,5 @@ /* --------------------------------------------------------------------------- - * $Id: Schedule.c,v 1.125 2002/02/15 14:49:08 simonmar Exp $ + * $Id: Schedule.c,v 1.126 2002/02/15 14:53:32 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -3090,6 +3090,14 @@ raiseAsync(StgTSO *tso, StgClosure *exception) */ sp = (P_)su - 1; + /* Ensure that async excpetions are blocked now, so we don't get + * a surprise exception before we get around to executing the + * handler. + */ + if (tso->blocked_exceptions == NULL) { + tso->blocked_exceptions = END_TSO_QUEUE; + } + /* Put the newly-built THUNK on top of the stack, ready to execute * when the thread restarts. */