aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-02-02 19:21:36 +0100
committerRickard Green <[email protected]>2017-02-02 19:35:15 +0100
commit9d927001ba16517042d3099612a2c9b130c6f62a (patch)
treed82e3f3dac7a53e9f0c3265e57594811edfb2ac5 /erts
parent51faafa9a20c4afa7944b8089b26f22c774bed19 (diff)
downloadotp-9d927001ba16517042d3099612a2c9b130c6f62a.tar.gz
otp-9d927001ba16517042d3099612a2c9b130c6f62a.tar.bz2
otp-9d927001ba16517042d3099612a2c9b130c6f62a.zip
Dirty schedulers should not touch scheduler data pointed to by process struct
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_process.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index b345c35a7e..cfa2b62061 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -9598,7 +9598,8 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
esdp->current_process = NULL;
#ifdef ERTS_SMP
- p->scheduler_data = NULL;
+ if (is_normal_sched)
+ p->scheduler_data = NULL;
#endif
erts_smp_proc_unlock(p, (ERTS_PROC_LOCK_MAIN
@@ -10013,8 +10014,8 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
state = erts_smp_atomic32_read_nob(&p->state);
- ASSERT(!p->scheduler_data);
#ifndef ERTS_DIRTY_SCHEDULERS
+ ASSERT(!p->scheduler_data);
p->scheduler_data = esdp;
#else /* ERTS_DIRTY_SCHEDULERS */
if (is_normal_sched) {
@@ -10025,6 +10026,7 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
goto sched_out_proc;
}
+ ASSERT(!p->scheduler_data);
p->scheduler_data = esdp;
}
else {