summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-12-16 09:33:37 -0500
committerBen Gamari <ben@smart-cactus.org>2021-01-25 14:33:20 -0500
commiteb74dbe526146a26350c3cfe3753240a930196df (patch)
tree09edd44b38939841afba4d3ee905be62a904c6aa
parent3fde03920055668463a1fe4cd02d257be0987f62 (diff)
downloadhaskell-eb74dbe526146a26350c3cfe3753240a930196df.tar.gz
rts/Messages: Relax locked-closure assertion
In general we are less careful about locking closures when running with only a single capability. Fixes #19075. (cherry picked from commit 87bc458de497cdc407c5c32572103a452ee36e4d)
-rw-r--r--rts/Messages.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/Messages.h b/rts/Messages.h
index 561eb449d2..fef4510740 100644
--- a/rts/Messages.h
+++ b/rts/Messages.h
@@ -25,8 +25,9 @@ void sendMessage (Capability *from_cap, Capability *to_cap, Message *msg);
INLINE_HEADER void
doneWithMsgThrowTo (Capability *cap, MessageThrowTo *m)
{
- // The message better be locked
- ASSERT(m->header.info == &stg_WHITEHOLE_info);
+ // The message better be locked (unless we are running single-threaded,
+ // where we are a bit more lenient (#19075).
+ ASSERT(n_capabilities == 1 || m->header.info == &stg_WHITEHOLE_info);
IF_NONMOVING_WRITE_BARRIER_ENABLED {
updateRemembSetPushClosure(cap, (StgClosure *) m->link);
updateRemembSetPushClosure(cap, (StgClosure *) m->source);