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

Handle renames from #3310

Also add a panic for resurrecting a thread blocked on an exception,
since it should never happen.
parent 90d1dedd
......@@ -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)
......
......@@ -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();
......
......@@ -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");
}
......
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