From: Simon Marlow Date: Sun, 30 Aug 2009 15:31:23 +0000 (+0000) Subject: Handle renames from #3310 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=a916885ce70142ae5c05cc9e28230c308821e3d6 Handle renames from #3310 Also add a panic for resurrecting a thread blocked on an exception, since it should never happen. --- diff --git a/rts/Prelude.h b/rts/Prelude.h index b27fa27..3d5101f 100644 --- a/rts/Prelude.h +++ b/rts/Prelude.h @@ -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) diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index 2c1c554..f0b2170 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -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(); diff --git a/rts/Schedule.c b/rts/Schedule.c index 07af0bf..05315a5 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -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"); }