aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-04-10 11:42:06 +0200
committerJohn Högberg <[email protected]>2018-04-16 15:44:56 +0200
commitc71d914fa41f3b272dc80fefc33c1bb40ca86652 (patch)
treeb84f780520dc986f24f474da5d39f6222069948c /erts/emulator
parent40dc6b9fed7d51a204e0d69b7bba7e8cb6496ae5 (diff)
downloadotp-c71d914fa41f3b272dc80fefc33c1bb40ca86652.tar.gz
otp-c71d914fa41f3b272dc80fefc33c1bb40ca86652.tar.bz2
otp-c71d914fa41f3b272dc80fefc33c1bb40ca86652.zip
erts: Update esdp->current_port on immediate port calls
This increases the accuracy of crash dumps and the upcoming allocation tagging feature.
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 66b8005975..10075c2c98 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -956,6 +956,9 @@ try_imm_drv_call(ErtsTryImmDrvCallState *sp)
reds_left_in = ERTS_BIF_REDS_LEFT(c_p);
erts_proc_unlock(c_p, ERTS_PROC_LOCK_MAIN);
+
+ ASSERT((c_p->scheduler_data)->current_port == NULL);
+ (c_p->scheduler_data)->current_port = prt;
}
ASSERT(0 <= reds_left_in && reds_left_in <= CONTEXT_REDS);
@@ -1017,6 +1020,9 @@ finalize_imm_drv_call(ErtsTryImmDrvCallState *sp)
erts_port_release(prt);
if (c_p) {
+ ASSERT((c_p->scheduler_data)->current_port == prt);
+ (c_p->scheduler_data)->current_port = NULL;
+
erts_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
if (reds != (CONTEXT_REDS - sp->reds_left_in)) {