aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2010-11-18 10:37:54 +0100
committerRickard Green <[email protected]>2010-11-18 10:37:54 +0100
commit983a6efa7827161e079da49d720c9e5646d384be (patch)
tree92b1dd019a49bfe797370c134ee4a029f5b3d1aa /erts/emulator/beam/erl_process.c
parentbce98193540c0f5f1e315a07ba4870056e7693c9 (diff)
parent77e8d12f0b0479bd9bddb5d4f54a4d9e0109b888 (diff)
downloadotp-983a6efa7827161e079da49d720c9e5646d384be.tar.gz
otp-983a6efa7827161e079da49d720c9e5646d384be.tar.bz2
otp-983a6efa7827161e079da49d720c9e5646d384be.zip
Merge branch 'rickard/sched-misc/OTP-8932' into dev
* rickard/sched-misc/OTP-8932: Fix erts_schedule_misc_op() so it can be called from arbitrary threads
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index b47ce97c46..f6afc066ce 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -7497,6 +7497,15 @@ erts_schedule_misc_op(void (*func)(void *), void *arg)
ErtsRunQueue *rq = erts_get_runq_current(NULL);
ErtsMiscOpList *molp = misc_op_list_alloc();
+ if (!rq) {
+ /*
+ * This can only happen when the sys msg dispatcher
+ * thread schedules misc ops (this happens *very*
+ * seldom; only when trace drivers are unloaded).
+ */
+ rq = ERTS_RUNQ_IX(0);
+ }
+
erts_smp_runq_lock(rq);
while (rq->misc.evac_runq) {