Skip to content

Commit

Permalink
Make sure we have a run_queue
Browse files Browse the repository at this point in the history
* In rare cases we could have no run_queue in schedule misc ops
  • Loading branch information
psyeugenic committed Sep 12, 2011
1 parent 8802241 commit 8d89620
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions erts/emulator/beam/erl_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down

0 comments on commit 8d89620

Please sign in to comment.