aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-01-18 18:47:30 +0100
committerSverker Eriksson <[email protected]>2016-01-18 18:47:30 +0100
commit52738d8bee488c262cf514ce4df49e87dfa47bc3 (patch)
tree977d1cc7a9ee2e707afa7a17d1273b89e4c7dd47 /erts/emulator/beam
parent74a95b3d511177a9b35c2b0272b9ca5511b6f750 (diff)
downloadotp-52738d8bee488c262cf514ce4df49e87dfa47bc3.tar.gz
otp-52738d8bee488c262cf514ce4df49e87dfa47bc3.tar.bz2
otp-52738d8bee488c262cf514ce4df49e87dfa47bc3.zip
erts: Fix race between receive timeout and exit signal
Must re-read 'state' after seizing proc locks as other thread may have set EXITING.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_process.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 7b3d12ce09..d767e1bb5a 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -9674,6 +9674,8 @@ Process *schedule(Process *p, int calls)
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
+ state = erts_smp_atomic32_read_nob(&p->state);
+
if (erts_sched_stat.enabled) {
int prio;
UWord old = ERTS_PROC_SCHED_ID(p,