aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_mode_switch.c
diff options
context:
space:
mode:
authorPaul Guyot <[email protected]>2011-05-21 08:51:45 +0200
committerPaul Guyot <[email protected]>2011-05-21 08:51:45 +0200
commit614c92088cb947a8849ab4681458b233d2151f40 (patch)
tree43595dcf02ebf5b3d8f9bc8462d0273544755566 /erts/emulator/hipe/hipe_mode_switch.c
parent5f7fa62cbfa18b88fc254fe362b11367177d2673 (diff)
downloadotp-614c92088cb947a8849ab4681458b233d2151f40.tar.gz
otp-614c92088cb947a8849ab4681458b233d2151f40.tar.bz2
otp-614c92088cb947a8849ab4681458b233d2151f40.zip
Fix bug related to hibernate and HiPE (clear F_HIBERNATE_SCHED flag)
F_HIBERNATE_SCHED flag that was introduced in b7ecdcd1ae9e11b8f75e must be cleared in hipe_mode_switch as well. Otherwise, processes running HiPE code that hibernate, wake up and then trap into a BIF will not be rescheduled.
Diffstat (limited to 'erts/emulator/hipe/hipe_mode_switch.c')
-rw-r--r--erts/emulator/hipe/hipe_mode_switch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/erts/emulator/hipe/hipe_mode_switch.c b/erts/emulator/hipe/hipe_mode_switch.c
index 16f8fb1347..e3e8367b62 100644
--- a/erts/emulator/hipe/hipe_mode_switch.c
+++ b/erts/emulator/hipe/hipe_mode_switch.c
@@ -346,7 +346,12 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
p->arity = callee_arity;
}
- /* If process is in P_WAITING state, we schedule the next process */
+ /* Schedule next process if current process was hibernated or is waiting
+ for messages */
+ if (p->flags & F_HIBERNATE_SCHED) {
+ p->flags &= ~F_HIBERNATE_SCHED;
+ goto do_schedule;
+ }
if (p->status == P_WAITING) {
goto do_schedule;
}