Permalink
Browse files

Merge branch 'rickard/port-sched-bug/OTP-10556' into maint

* rickard/port-sched-bug/OTP-10556:
  Fix bug in erts_port_task_schedule()
  • Loading branch information...
rickard-green committed Nov 12, 2012
2 parents befc4a7 + 0ba7c70 commit 135fdb3b1804089c5170c5995a9dae653a28f927
Showing with 8 additions and 8 deletions.
  1. +8 −8 erts/emulator/beam/erl_port_task.c
@@ -573,26 +573,26 @@ erts_port_task_schedule(Eterm id,
ERTS_PT_CHK_PRES_PORTQ(runq, pp);
- if (!pp->sched.taskq) {
- pp->sched.taskq = port_taskq_init(port_taskq_alloc(), pp);
- enq_port = !pp->sched.exe_taskq;
- }
-
+ if (!pp->sched.taskq && !pp->sched.exe_taskq) {
#ifdef ERTS_SMP
- if (enq_port) {
ErtsRunQueue *xrunq = erts_check_emigration_need(runq, ERTS_PORT_PRIO_LEVEL);
if (xrunq) {
/* Port emigrated ... */
erts_smp_atomic_set_nob(&pp->run_queue, (erts_aint_t) xrunq);
erts_smp_runq_unlock(runq);
runq = xrunq;
}
- }
+ enq_port = !pp->sched.taskq && !pp->sched.exe_taskq;
+#else
+ enq_port = 1;
#endif
+ }
ASSERT(!enq_port || !(runq->flags & ERTS_RUNQ_FLG_SUSPENDED));
- ASSERT(pp->sched.taskq);
+ if (!pp->sched.taskq)
+ pp->sched.taskq = port_taskq_init(port_taskq_alloc(), pp);
+
ASSERT(ptp);
ptp->type = type;

0 comments on commit 135fdb3

Please sign in to comment.