Fix two more locking issues in throwTo()
authorBertram Felgenhauer <int-e@gmx.de>
Wed, 7 Jan 2009 12:08:08 +0000 (12:08 +0000)
committerBertram Felgenhauer <int-e@gmx.de>
Wed, 7 Jan 2009 12:08:08 +0000 (12:08 +0000)
rts/RaiseAsync.c

index 10c9b7c..1a57e47 100644 (file)
@@ -415,6 +415,7 @@ check_target:
        // Unblocking BlockedOnSTM threads requires the TSO to be
        // locked; see STM.c:unpark_tso().
        if (target->why_blocked != BlockedOnSTM) {
        // Unblocking BlockedOnSTM threads requires the TSO to be
        // locked; see STM.c:unpark_tso().
        if (target->why_blocked != BlockedOnSTM) {
+           unlockTSO(target);
            goto retry;
        }
        if ((target->flags & TSO_BLOCKEX) &&
            goto retry;
        }
        if ((target->flags & TSO_BLOCKEX) &&
@@ -436,6 +437,11 @@ check_target:
        // thread is blocking exceptions, and block on its
        // blocked_exception queue.
        lockTSO(target);
        // thread is blocking exceptions, and block on its
        // blocked_exception queue.
        lockTSO(target);
+       if (target->why_blocked != BlockedOnCCall &&
+           target->why_blocked != BlockedOnCCall_NoUnblockExc) {
+           unlockTSO(target);
+            goto retry;
+       }
        blockedThrowTo(cap,source,target);
        *out = target;
        return THROWTO_BLOCKED;
        blockedThrowTo(cap,source,target);
        *out = target;
        return THROWTO_BLOCKED;