aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-08-11 15:45:05 +0200
committerRickard Green <[email protected]>2016-08-11 16:22:18 +0200
commit17c838402c6d71aef041548ad36ee66db6f24a56 (patch)
tree7d0074dc86913ddb0812157e0d8513d729cbc0ff /erts/emulator/beam/beam_emu.c
parent74a95b3d511177a9b35c2b0272b9ca5511b6f750 (diff)
downloadotp-17c838402c6d71aef041548ad36ee66db6f24a56.tar.gz
otp-17c838402c6d71aef041548ad36ee66db6f24a56.tar.bz2
otp-17c838402c6d71aef041548ad36ee66db6f24a56.zip
Fix race causing lost wakeup on receive-after timeout
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r--erts/emulator/beam/beam_emu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 8b409e139b..17df14acfe 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -2166,7 +2166,10 @@ void process_main(void)
c_p->i = (BeamInstr *) Arg(0); /* L1 */
SWAPOUT;
c_p->arity = 0;
- erts_smp_atomic32_read_band_relb(&c_p->state, ~ERTS_PSFLG_ACTIVE);
+
+ if (!ERTS_PTMR_IS_TIMED_OUT(c_p))
+ erts_smp_atomic32_read_band_relb(&c_p->state,
+ ~ERTS_PSFLG_ACTIVE);
ASSERT(!ERTS_PROC_IS_EXITING(c_p));
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
c_p->current = NULL;