summaryrefslogtreecommitdiff
path: root/rts/HeapStackCheck.cmm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-03-11 12:37:05 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-03-11 12:37:05 +0000
commit1e31c2960f7a9fc61119237d8a35b0516d6accca (patch)
tree0de5f1c0653b06a69a2c0c4208b43ab00632e840 /rts/HeapStackCheck.cmm
parent7408b39235bccdcde48df2a73337ff976fbc09b7 (diff)
downloadhaskell-1e31c2960f7a9fc61119237d8a35b0516d6accca.tar.gz
Fix a couple of bugs in the throwTo handling, exposed by conc016(threaded2)
Diffstat (limited to 'rts/HeapStackCheck.cmm')
-rw-r--r--rts/HeapStackCheck.cmm8
1 files changed, 6 insertions, 2 deletions
diff --git a/rts/HeapStackCheck.cmm b/rts/HeapStackCheck.cmm
index a528a3f22e..ba672bf805 100644
--- a/rts/HeapStackCheck.cmm
+++ b/rts/HeapStackCheck.cmm
@@ -631,8 +631,12 @@ INFO_TABLE_RET( stg_block_throwto, RET_SMALL, P_ unused, P_ unused )
stg_block_throwto_finally
{
- // unlock the throwto message
- unlockClosure(StgTSO_block_info(CurrentTSO), stg_MSG_THROWTO_info);
+ // unlock the throwto message, but only if it wasn't already
+ // unlocked. It may have been unlocked if we revoked the message
+ // due to an exception being raised during threadPaused().
+ if (StgHeader_info(StgTSO_block_info(CurrentTSO)) == stg_WHITEHOLE_info) {
+ unlockClosure(StgTSO_block_info(CurrentTSO), stg_MSG_THROWTO_info);
+ }
jump StgReturn;
}