[project @ 2005-10-27 15:17:11 by simonmar]
authorsimonmar <unknown>
Thu, 27 Oct 2005 15:17:11 +0000 (15:17 +0000)
committersimonmar <unknown>
Thu, 27 Oct 2005 15:17:11 +0000 (15:17 +0000)
unpark_tso: call unblockOne() instead of doing the job inline.  This
properly migrates the thread, setting its task to point back to the
right capability, if necessary.

ghc/rts/STM.c

index e92763f..282ab74 100644 (file)
@@ -328,8 +328,7 @@ static void unpark_tso(Capability *cap, StgTSO *tso) {
   // if it decides to do so when it is scheduled.
   if (tso -> why_blocked == BlockedOnSTM) {
     TRACE("unpark_tso on tso=%p\n", tso);
-    tso -> why_blocked = NotBlocked;
-    pushOnRunQueue(cap,tso);
+    unblockOne(cap,tso);
   } else {
     TRACE("spurious unpark_tso on tso=%p\n", tso);
   }