X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FSchedule.c;h=299e13254844009c221b0472b045f89a96b0f6df;hb=cbc83989fe39607eec0dcb6a84f6086a9e0bb442;hp=35e87e00a39cb50d991181724a45ea2bf49065cb;hpb=d3313aea18753dc8c1734be2567fd35c3ae040f5;p=ghc-hetmet.git diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 35e87e0..299e132 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -615,6 +615,18 @@ run_thread: // happened. So find the new location: t = cap->r.rCurrentTSO; + // We have run some Haskell code: there might be blackhole-blocked + // threads to wake up now. + // Lock-free test here should be ok, we're just setting a flag. + if ( blackhole_queue != END_TSO_QUEUE ) { + blackholes_need_checking = rtsTrue; + } + + // And save the current errno in this thread. + // XXX: possibly bogus for SMP because this thread might already + // be running again, see code below. + t->saved_errno = errno; + #ifdef SMP // If ret is ThreadBlocked, and this Task is bound to the TSO that // blocked, we are in limbo - the TSO is now owned by whatever it @@ -632,9 +644,6 @@ run_thread: ASSERT_CAPABILITY_INVARIANTS(cap,task); - // And save the current errno in this thread. - t->saved_errno = errno; - // ---------------------------------------------------------------------- // Costs for the scheduler are assigned to CCS_SYSTEM @@ -643,13 +652,6 @@ run_thread: CCCS = CCS_SYSTEM; #endif - // We have run some Haskell code: there might be blackhole-blocked - // threads to wake up now. - // Lock-free test here should be ok, we're just setting a flag. - if ( blackhole_queue != END_TSO_QUEUE ) { - blackholes_need_checking = rtsTrue; - } - #if defined(THREADED_RTS) IF_DEBUG(scheduler,debugBelch("sched (task %p): ", (void *)(unsigned long)(unsigned int)osThreadId());); #elif !defined(GRAN) && !defined(PARALLEL_HASKELL)