From: simonmar Date: Mon, 4 Oct 1999 16:13:18 +0000 (+0000) Subject: [project @ 1999-10-04 16:13:18 by simonmar] X-Git-Tag: Approximately_9120_patches~5733 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c4729619f98b8aee2ea5555638f939518b7edd00;p=ghc-hetmet.git [project @ 1999-10-04 16:13:18 by simonmar] allow raising exceptions in threads blocked on I/O or time delays --- diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 30381a4..8f3f7e3 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Schedule.c,v 1.25 1999/09/10 11:11:51 simonmar Exp $ + * $Id: Schedule.c,v 1.26 1999/10/04 16:13:18 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -732,11 +732,23 @@ unblockThread(StgTSO *tso) barf("unblockThread (BLACKHOLE): TSO not found"); } + case BlockedOnDelay: case BlockedOnRead: case BlockedOnWrite: - case BlockedOnDelay: - /* ToDo */ - barf("unblockThread {read,write,delay}"); + { + last = &blocked_queue_hd; + for (t = blocked_queue_hd; t != END_TSO_QUEUE; + last = &t->link, t = t->link) { + if (t == tso) { + *last = tso->link; + if (blocked_queue_tl == t) { + blocked_queue_tl = tso->link; + } + goto done; + } + } + barf("unblockThread (I/O): TSO not found"); + } default: barf("unblockThread");