diff options
author | Rickard Green <[email protected]> | 2014-08-05 17:33:19 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2014-08-05 20:22:27 +0200 |
commit | 961cfeb7b30d721ac8264261d89bb7a4bd3182e5 (patch) | |
tree | 9a2fcba1982668a6bceb86cbf7a9173a5232c9d5 /erts/emulator/beam | |
parent | 461dc05384eece7b4b7d84370fb0a2cf96ed2f6d (diff) | |
download | otp-961cfeb7b30d721ac8264261d89bb7a4bd3182e5.tar.gz otp-961cfeb7b30d721ac8264261d89bb7a4bd3182e5.tar.bz2 otp-961cfeb7b30d721ac8264261d89bb7a4bd3182e5.zip |
Fix abort of nosuspend-tasks in erts_port_task_schedule()
The counter for the amount of outstanding data in the port queue
became inconsistent when aborting nosuspend-signals in
erts_port_task_schedule(). This since the counter was subtracted
by the data size of the signal although the data size had never
been added to it. This inconsistency caused the port queue to
remain in a busy state forever.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/erl_port_task.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_port_task.c b/erts/emulator/beam/erl_port_task.c index 31d9a1e26e..2fc95ed5d8 100644 --- a/erts/emulator/beam/erl_port_task.c +++ b/erts/emulator/beam/erl_port_task.c @@ -798,12 +798,13 @@ schedule_port_task_handle_list_free(ErtsPortTaskHandleList *pthlp) static ERTS_INLINE void abort_nosuspend_task(Port *pp, ErtsPortTaskType type, - ErtsPortTaskTypeData *tdp) + ErtsPortTaskTypeData *tdp, + int bpq_data) { ASSERT(type == ERTS_PORT_TASK_PROC_SIG); - if (!pp->sched.taskq.bpq) + if (!bpq_data) tdp->psig.callback(NULL, ERTS_PORT_SFLG_INVALID, ERTS_PROC2PORT_SIG_ABORT_NOSUSPEND, @@ -1345,7 +1346,7 @@ erts_port_task_abort_nosuspend_tasks(Port *pp) #endif schedule_port_task_handle_list_free(pthlp); - abort_nosuspend_task(pp, type, &td); + abort_nosuspend_task(pp, type, &td, pp->sched.taskq.bpq != NULL); } } @@ -1525,7 +1526,7 @@ abort_nosuspend: erts_port_dec_refc(pp); #endif - abort_nosuspend_task(pp, ptp->type, &ptp->u.alive.td); + abort_nosuspend_task(pp, ptp->type, &ptp->u.alive.td, 0); ASSERT(ns_pthlp); erts_free(ERTS_ALC_T_PT_HNDL_LIST, ns_pthlp); |