From 52738d8bee488c262cf514ce4df49e87dfa47bc3 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 18 Jan 2016 18:47:30 +0100 Subject: erts: Fix race between receive timeout and exit signal Must re-read 'state' after seizing proc locks as other thread may have set EXITING. --- erts/emulator/beam/erl_process.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts') 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, -- cgit v1.2.3