Handle renames from #3310
authorSimon Marlow <marlowsd@gmail.com>
Sun, 30 Aug 2009 15:31:23 +0000 (15:31 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Sun, 30 Aug 2009 15:31:23 +0000 (15:31 +0000)
Also add a panic for resurrecting a thread blocked on an exception,
since it should never happen.

rts/Prelude.h
rts/RtsStartup.c
rts/Schedule.c

index b27fa27..3d5101f 100644 (file)
@@ -37,8 +37,8 @@ extern StgClosure ZCMain_main_closure;
 
 PRELUDE_CLOSURE(base_GHCziIOziException_stackOverflow_closure);
 PRELUDE_CLOSURE(base_GHCziIOziException_heapOverflow_closure);
-PRELUDE_CLOSURE(base_GHCziIOziException_blockedOnDeadMVar_closure);
-PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitely_closure);
+PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure);
+PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure);
 PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination_closure);
 PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
 
@@ -89,8 +89,8 @@ PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
 
 #define stackOverflow_closure     DLL_IMPORT_DATA_REF(base_GHCziIOziException_stackOverflow_closure)
 #define heapOverflow_closure      DLL_IMPORT_DATA_REF(base_GHCziIOziException_heapOverflow_closure)
-#define blockedOnDeadMVar_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedOnDeadMVar_closure)
-#define blockedIndefinitely_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitely_closure)
+#define blockedIndefinitelyOnMVar_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure)
+#define blockedIndefinitelyOnSTM_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure)
 #define nonTermination_closure    DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nonTermination_closure)
 #define nestedAtomically_closure  DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nestedAtomically_closure)
 
index 2c1c554..f0b2170 100644 (file)
@@ -171,9 +171,9 @@ hs_init(int *argc, char **argv[])
     getStablePtr((StgPtr)heapOverflow_closure);
     getStablePtr((StgPtr)runFinalizerBatch_closure);
     getStablePtr((StgPtr)unpackCString_closure);
-    getStablePtr((StgPtr)blockedOnDeadMVar_closure);
+    getStablePtr((StgPtr)blockedIndefinitelyOnMVar_closure);
     getStablePtr((StgPtr)nonTermination_closure);
-    getStablePtr((StgPtr)blockedIndefinitely_closure);
+    getStablePtr((StgPtr)blockedIndefinitelyOnSTM_closure);
 
     /* initialise the shared Typeable store */
     initGlobalStore();
index 07af0bf..05315a5 100644 (file)
@@ -2667,10 +2667,9 @@ resurrectThreads (StgTSO *threads)
        
        switch (tso->why_blocked) {
        case BlockedOnMVar:
-       case BlockedOnException:
            /* Called by GC - sched_mutex lock is currently held. */
            throwToSingleThreaded(cap, tso,
-                                 (StgClosure *)blockedOnDeadMVar_closure);
+                                 (StgClosure *)blockedIndefinitelyOnMVar_closure);
            break;
        case BlockedOnBlackHole:
            throwToSingleThreaded(cap, tso,
@@ -2678,7 +2677,7 @@ resurrectThreads (StgTSO *threads)
            break;
        case BlockedOnSTM:
            throwToSingleThreaded(cap, tso,
-                                 (StgClosure *)blockedIndefinitely_closure);
+                                 (StgClosure *)blockedIndefinitelyOnSTM_closure);
            break;
        case NotBlocked:
            /* This might happen if the thread was blocked on a black hole
@@ -2686,6 +2685,11 @@ resurrectThreads (StgTSO *threads)
             * can wake up threads, remember...).
             */
            continue;
+       case BlockedOnException:
+            // throwTo should never block indefinitely: if the target
+            // thread dies or completes, throwTo returns.
+           barf("resurrectThreads: thread BlockedOnException");
+            break;
        default:
            barf("resurrectThreads: thread blocked in a strange way");
        }