aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2011-09-12 16:38:59 +0200
committerBjörn-Egil Dahlberg <[email protected]>2011-09-12 16:38:59 +0200
commit8d89620380fc8cff66ac6bab3e781058191ce0a3 (patch)
tree7bbc04645cb2f1bf7a2f42ba7db1f114ec4dea3d
parent8802241a20aaa3fb1e101f087812aa8db92a1ea7 (diff)
downloadotp-8d89620380fc8cff66ac6bab3e781058191ce0a3.tar.gz
otp-8d89620380fc8cff66ac6bab3e781058191ce0a3.tar.bz2
otp-8d89620380fc8cff66ac6bab3e781058191ce0a3.zip
Make sure we have a run_queue
* In rare cases we could have no run_queue in schedule misc ops
-rw-r--r--erts/emulator/beam/erl_process.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 2704359a8f..d8aed63544 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -5782,10 +5782,13 @@ erts_sched_stat_term(Process *p, int total)
void
erts_schedule_misc_op(void (*func)(void *), void *arg)
{
- ErtsRunQueue *rq = erts_get_runq_current(NULL);
+ ErtsRunQueue *rq;
ErtsMiscOpList *molp = misc_op_list_alloc();
+ ErtsSchedulerData *esdp = erts_get_scheduler_data();
- if (!rq) {
+ if (esdp) {
+ rq = esdp->run_queue;
+ } else {
/*
* This can only happen when the sys msg dispatcher
* thread schedules misc ops (this happens *very*