diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 30381a4eaa84e71154086fa8d3309db0910cb5dc..8f3f7e323c46b9530dae7836a8186d9070adf902 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");