Commit f18399d3 authored by Simon Marlow's avatar Simon Marlow
Browse files

minor refactoring

parent b7212d4b
...@@ -57,15 +57,9 @@ static void throwToSendMsg (Capability *cap USED_IF_THREADS, ...@@ -57,15 +57,9 @@ static void throwToSendMsg (Capability *cap USED_IF_THREADS,
has been raised. has been raised.
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void static void
throwToSingleThreaded(Capability *cap, StgTSO *tso, StgClosure *exception) throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception,
{ rtsBool stop_at_atomically, StgUpdateFrame *stop_here)
throwToSingleThreaded_(cap, tso, exception, rtsFalse);
}
void
throwToSingleThreaded_(Capability *cap, StgTSO *tso, StgClosure *exception,
rtsBool stop_at_atomically)
{ {
tso = deRefTSO(tso); tso = deRefTSO(tso);
...@@ -77,23 +71,26 @@ throwToSingleThreaded_(Capability *cap, StgTSO *tso, StgClosure *exception, ...@@ -77,23 +71,26 @@ throwToSingleThreaded_(Capability *cap, StgTSO *tso, StgClosure *exception,
// Remove it from any blocking queues // Remove it from any blocking queues
removeFromQueues(cap,tso); removeFromQueues(cap,tso);
raiseAsync(cap, tso, exception, stop_at_atomically, NULL); raiseAsync(cap, tso, exception, stop_at_atomically, stop_here);
} }
void void
suspendComputation(Capability *cap, StgTSO *tso, StgUpdateFrame *stop_here) throwToSingleThreaded (Capability *cap, StgTSO *tso, StgClosure *exception)
{ {
tso = deRefTSO(tso); throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL);
}
// Thread already dead?
if (tso->what_next == ThreadComplete || tso->what_next == ThreadKilled) {
return;
}
// Remove it from any blocking queues void
removeFromQueues(cap,tso); 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: ...@@ -406,7 +403,8 @@ check_target:
} }
if (task != NULL) { if (task != NULL) {
blockedThrowTo(cap, target, msg); 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); interruptWorkerTask(task);
} }
return THROWTO_BLOCKED; return THROWTO_BLOCKED;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment