summaryrefslogtreecommitdiff
path: root/rts/Threads.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-27 15:49:03 +0000
committerBen Gamari <ben@smart-cactus.org>2020-10-24 21:00:36 -0400
commit65219810a41f1c903838185a766baeba8954cc88 (patch)
treee8978410b5a6026707f6087cd51028f5c910a0e6 /rts/Threads.c
parentf6b4b492d9c112c30ddc0bda2338b143b56faf4c (diff)
downloadhaskell-65219810a41f1c903838185a766baeba8954cc88.tar.gz
rts: Add assertions for task ownership of capabilities
Diffstat (limited to 'rts/Threads.c')
-rw-r--r--rts/Threads.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rts/Threads.c b/rts/Threads.c
index 54c703963e..2e1da17d6f 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -355,9 +355,11 @@ unblock:
migrateThread
------------------------------------------------------------------------- */
+// Precondition: The caller must own the `from` capability.
void
migrateThread (Capability *from, StgTSO *tso, Capability *to)
{
+ ASSERT_FULL_CAPABILITY_INVARIANTS(from, getTask());
traceEventMigrateThread (from, tso, to->no);
// ThreadMigrating tells the target cap that it needs to be added to
// the run queue when it receives the MSG_TRY_WAKEUP.