diff options
author | Edward Z. Yang <ezyang@mit.edu> | 2010-09-25 03:30:26 +0000 |
---|---|---|
committer | Edward Z. Yang <ezyang@mit.edu> | 2010-09-25 03:30:26 +0000 |
commit | 539d3adec64f51a3fb13bb65b7a494d7eded01a0 (patch) | |
tree | d70b17364ff81c6888e3ac9338aaa5239c426515 /rts/RaiseAsync.c | |
parent | 83d563cb9ede0ba792836e529b1e2929db926355 (diff) | |
download | haskell-539d3adec64f51a3fb13bb65b7a494d7eded01a0.tar.gz |
Don't interrupt when task blocks exceptions, don't immediately start exception.
Diffstat (limited to 'rts/RaiseAsync.c')
-rw-r--r-- | rts/RaiseAsync.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c index b94ccea283..cbbdc95beb 100644 --- a/rts/RaiseAsync.c +++ b/rts/RaiseAsync.c @@ -405,9 +405,11 @@ check_target: } } if (task != NULL) { - raiseAsync(cap, target, msg->exception, rtsFalse, NULL); - interruptWorkerTask(task); - return THROWTO_SUCCESS; + blockedThrowTo(cap, target, msg); + if (!((target->flags & TSO_BLOCKEX) && ((target->flags & TSO_INTERRUPTIBLE) == 0))) { + interruptWorkerTask(task); + } + return THROWTO_BLOCKED; } else { debugTraceCap(DEBUG_sched, cap, "throwTo: could not find worker thread to kill"); } @@ -665,6 +667,14 @@ 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); } |