X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRaiseAsync.c;h=628dff8ce8a27e5c4011a8153143e63e34e4c078;hb=2207ce8cdc4c33838f77f285c7dd4f7c75dbae1c;hp=cbbdc95beb5c92d3d75b373d837531009974626a;hpb=539d3adec64f51a3fb13bb65b7a494d7eded01a0;p=ghc-hetmet.git diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c index cbbdc95..628dff8 100644 --- a/rts/RaiseAsync.c +++ b/rts/RaiseAsync.c @@ -57,15 +57,9 @@ static void throwToSendMsg (Capability *cap USED_IF_THREADS, has been raised. -------------------------------------------------------------------------- */ -void -throwToSingleThreaded(Capability *cap, StgTSO *tso, StgClosure *exception) -{ - throwToSingleThreaded_(cap, tso, exception, rtsFalse); -} - -void -throwToSingleThreaded_(Capability *cap, StgTSO *tso, StgClosure *exception, - rtsBool stop_at_atomically) +static void +throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception, + rtsBool stop_at_atomically, StgUpdateFrame *stop_here) { tso = deRefTSO(tso); @@ -77,23 +71,26 @@ throwToSingleThreaded_(Capability *cap, StgTSO *tso, StgClosure *exception, // Remove it from any blocking queues removeFromQueues(cap,tso); - raiseAsync(cap, tso, exception, stop_at_atomically, NULL); + raiseAsync(cap, tso, exception, stop_at_atomically, stop_here); } void -suspendComputation(Capability *cap, StgTSO *tso, StgUpdateFrame *stop_here) +throwToSingleThreaded (Capability *cap, StgTSO *tso, StgClosure *exception) { - tso = deRefTSO(tso); - - // Thread already dead? - if (tso->what_next == ThreadComplete || tso->what_next == ThreadKilled) { - return; - } + throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL); +} - // Remove it from any blocking queues - removeFromQueues(cap,tso); +void +throwToSingleThreaded_ (Capability *cap, StgTSO *tso, StgClosure *exception, + rtsBool stop_at_atomically) +{ + throwToSingleThreaded__ (cap, tso, exception, stop_at_atomically, NULL); +} - raiseAsync(cap, tso, NULL, rtsFalse, stop_here); +void +suspendComputation (Capability *cap, StgTSO *tso, StgUpdateFrame *stop_here) +{ + throwToSingleThreaded__ (cap, tso, NULL, rtsFalse, stop_here); } /* ----------------------------------------------------------------------------- @@ -406,7 +403,8 @@ check_target: } if (task != NULL) { blockedThrowTo(cap, target, msg); - if (!((target->flags & TSO_BLOCKEX) && ((target->flags & TSO_INTERRUPTIBLE) == 0))) { + if (!((target->flags & TSO_BLOCKEX) && + ((target->flags & TSO_INTERRUPTIBLE) == 0))) { interruptWorkerTask(task); } return THROWTO_BLOCKED; @@ -667,14 +665,6 @@ removeFromQueues(Capability *cap, StgTSO *tso) goto done; #endif - case BlockedOnCCall_Interruptible: - case BlockedOnCCall: - // ccall shouldn't be put on the run queue, because whenever - // we raise an exception for such a blocked thread, it's only - // when we're /exiting/ the call. - tso->why_blocked = NotBlocked; - return; - default: barf("removeFromQueues: %d", tso->why_blocked); }