[commit: ghc] ghc-lwc: Fixes for getting the correct thread status when a task loses control of the capability on a safe-foreign call. (76bf4ef)

Sivaramakrishnan Krishnamoorthy Chandrasekaran kc at galois.com
Wed May 9 23:06:41 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-lwc

http://hackage.haskell.org/trac/ghc/changeset/76bf4ef802fbbd9ef30f4941749a9e2e1cc7ab43

>---------------------------------------------------------------

commit 76bf4ef802fbbd9ef30f4941749a9e2e1cc7ab43
Author: kc <chandras at cs.purdue.edu>
Date:   Wed May 9 16:17:03 2012 -0400

    Fixes for getting the correct thread status when a task loses control of the capability on a safe-foreign call.

>---------------------------------------------------------------

 rts/Schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rts/Schedule.c b/rts/Schedule.c
index 3c5bc0c..4129333 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -1195,7 +1195,7 @@ schedulePostRunThread (Capability *cap, StgTSO *t)
  * Handle a thread that returned to the scheduler with ThreadHeapOverflow
  * -------------------------------------------------------------------------- */
 
-    static rtsBool
+static rtsBool
 scheduleHandleHeapOverflow( Capability *cap, StgTSO *t )
 {
     IF_DEBUG (sanity, checkTSO (t));
@@ -2425,6 +2425,7 @@ resumeThread (void *task_)
     if (incall->uls_stat == UserLevelSchedulerRunning) {
         //Evaluate the unblock action on the upcall thread
         pushUpcallReturning (cap, getResumeThreadUpcall (cap, tso));
+        tso->why_blocked = Yielded;
         tso = prepareUpcallThread (cap, (StgTSO*)END_TSO_QUEUE);
     }
 #endif





More information about the Cvs-ghc mailing list