summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-08-30 15:31:23 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-08-30 15:31:23 +0000
commita916885ce70142ae5c05cc9e28230c308821e3d6 (patch)
tree6a47be14ef0f0dfeca9dab097a5a2d09780c8ff0 /rts
parent90d1deddda8123c46c4d029439591075ff310fb4 (diff)
downloadhaskell-a916885ce70142ae5c05cc9e28230c308821e3d6.tar.gz
Handle renames from #3310
Also add a panic for resurrecting a thread blocked on an exception, since it should never happen.
Diffstat (limited to 'rts')
-rw-r--r--rts/Prelude.h8
-rw-r--r--rts/RtsStartup.c4
-rw-r--r--rts/Schedule.c10
3 files changed, 13 insertions, 9 deletions
diff --git a/rts/Prelude.h b/rts/Prelude.h
index b27fa2708f..3d5101fce6 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 2c1c5549f1..f0b2170bad 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 07af0bf3ea..05315a59d9 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");
}