aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2011-04-08 15:11:46 +0200
committerRickard Green <[email protected]>2011-04-11 17:29:38 +0200
commite63eb63e2e8b8298826f2df7192e982a4e272749 (patch)
treebf57f84c39973dfe5d7621c9de2e997d0aaa48ee /erts/emulator/beam
parent4458257e5c9c48d43fa0ea4fa981436f364e14e2 (diff)
downloadotp-e63eb63e2e8b8298826f2df7192e982a4e272749.tar.gz
otp-e63eb63e2e8b8298826f2df7192e982a4e272749.tar.bz2
otp-e63eb63e2e8b8298826f2df7192e982a4e272749.zip
Fix lost wakeup when process garbage collected by other
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_process.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index f6e4e9df11..21625921d5 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -7609,10 +7609,28 @@ timeout_proc(Process* p)
p->flags |= F_TIMO;
p->flags &= ~F_INSLPQUEUE;
- if (p->status == P_WAITING)
- erts_add_to_runq(p);
- if (p->status == P_SUSPENDED)
+ switch (p->status) {
+ case P_GARBING:
+ switch (p->gcstatus) {
+ case P_SUSPENDED:
+ goto suspended;
+ case P_WAITING:
+ goto waiting;
+ default:
+ break;
+ }
+ break;
+ case P_WAITING:
+ waiting:
+ erts_add_to_runq(p);
+ break;
+ case P_SUSPENDED:
+ suspended:
p->rstatus = P_RUNABLE; /* MUST set resume status to runnable */
+ break;
+ default:
+ break;
+ }
}