summaryrefslogtreecommitdiff
path: root/rts/Threads.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-03-29 14:46:13 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-03-29 14:46:13 +0000
commit848797ebb9b60cf9c8a004c97afd008f5325c75f (patch)
tree155a9fc6a4495d06694cc4956dc4461179fe5d7c /rts/Threads.c
parent1373cd3085b8dec456e6118c58e940718cb9d559 (diff)
downloadhaskell-848797ebb9b60cf9c8a004c97afd008f5325c75f.tar.gz
change throwTo to use tryWakeupThread rather than unblockOne
Diffstat (limited to 'rts/Threads.c')
-rw-r--r--rts/Threads.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/rts/Threads.c b/rts/Threads.c
index 0c3e591665..05a13c7f3b 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -290,12 +290,31 @@ tryWakeupThread (Capability *cap, StgTSO *tso)
SET_HDR(msg, &stg_MSG_TRY_WAKEUP_info, CCS_SYSTEM);
msg->tso = tso;
sendMessage(cap, tso->cap, (Message*)msg);
+ debugTraceCap(DEBUG_sched, cap, "message: try wakeup thread %ld on cap %d",
+ (lnat)tso->id, tso->cap->no);
return;
}
#endif
switch (tso->why_blocked)
{
+ case BlockedOnMsgThrowTo:
+ {
+ const StgInfoTable *i;
+
+ i = lockClosure(tso->block_info.closure);
+ unlockClosure(tso->block_info.closure, i);
+ if (i != &stg_MSG_NULL_info) {
+ debugTraceCap(DEBUG_sched, cap, "thread %ld still blocked on throwto (%p)",
+ (lnat)tso->id, tso->block_info.throwto->header.info);
+ break; // still blocked
+ }
+
+ // remove the block frame from the stack
+ ASSERT(tso->sp[0] == (StgWord)&stg_block_throwto_info);
+ tso->sp += 3;
+ // fall through...
+ }
case BlockedOnBlackHole:
case BlockedOnSTM:
{