aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-05-29 16:23:04 +0200
committerBjörn Gustavsson <[email protected]>2017-05-29 16:23:04 +0200
commit9c2cd12d1c3136fc493210ce3ea03922af7e7835 (patch)
tree3cf4b99ebe1abe8bd01a6e01b3d9ae8f74421ae3 /erts
parent2c90f7c5afa58bbf64a27ccdf0d7f904c954fe46 (diff)
parentc819af0538083d861e8bd8ba66768f5e5a633311 (diff)
downloadotp-9c2cd12d1c3136fc493210ce3ea03922af7e7835.tar.gz
otp-9c2cd12d1c3136fc493210ce3ea03922af7e7835.tar.bz2
otp-9c2cd12d1c3136fc493210ce3ea03922af7e7835.zip
Merge branch 'bjorn/erts/fix-sys-task-cleanup'
* bjorn/erts/fix-sys-task-cleanup: erl_process.c: Add more assertions in process termination Make sure that asynchronous replies are not lost
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_process.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 7952e3031d..d4385e3987 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -11331,7 +11331,9 @@ cleanup_sys_tasks(Process *c_p, erts_aint32_t in_state, int in_reds)
erts_aint32_t state = in_state;
int max_reds = in_reds;
int reds = 0;
- int qmask = 0;
+ int qmask = 1; /* Set to 1 to force looping as long as there
+ * are dirty tasks.
+ */
ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(c_p) == ERTS_PROC_LOCK_MAIN);
@@ -13935,6 +13937,16 @@ erts_continue_exit_process(Process *p)
goto yield;
}
+#ifdef DEBUG
+ erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
+ ASSERT(p->sys_task_qs == NULL);
+ ASSERT(ERTS_PROC_GET_DELAYED_GC_TASK_QS(p) == NULL);
+#ifdef ERTS_DIRTY_SCHEDULERS
+ ASSERT(p->dirty_sys_tasks == NULL);
+#endif
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+#endif
+
if (p->flags & F_USING_DDLL) {
erts_ddll_proc_dead(p, ERTS_PROC_LOCK_MAIN);
p->flags &= ~F_USING_DDLL;