summaryrefslogtreecommitdiff
path: root/rts/RaiseAsync.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-09-26 10:58:19 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-09-26 10:58:19 +0000
commitf18399d395446674e7da58bdd8c4311fac4d799e (patch)
treeedef2fe7db9088c814cea19a067bc0607d27af54 /rts/RaiseAsync.c
parentb7212d4b53d12523c72cefe0d5cc3d318d3399a7 (diff)
downloadhaskell-f18399d395446674e7da58bdd8c4311fac4d799e.tar.gz
minor refactoring
Diffstat (limited to 'rts/RaiseAsync.c')
-rw-r--r--rts/RaiseAsync.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c
index c4c3f1dc72..628dff8ce8 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;