diff options
author | Lukas Larsson <[email protected]> | 2018-12-06 11:45:13 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2018-12-06 11:45:13 +0100 |
commit | 73e4f5f21bbf492ab61c01dee48fa09fd7309a50 (patch) | |
tree | 5f4b82eda1098a94d5fee94232a2819b77a3315a /erts/emulator/beam/erl_hl_timer.c | |
parent | 63e436ae75584c885e4c66c08d5f33c68f67e69e (diff) | |
parent | c6498571109b524fb319300e1b177b942e556f1b (diff) | |
download | otp-73e4f5f21bbf492ab61c01dee48fa09fd7309a50.tar.gz otp-73e4f5f21bbf492ab61c01dee48fa09fd7309a50.tar.bz2 otp-73e4f5f21bbf492ab61c01dee48fa09fd7309a50.zip |
Merge branch 'lukas/OTP-21.1.1/scheduler_pollset/OTP-15475' into maint
* lukas/OTP-21.1.1/scheduler_pollset/OTP-15475:
erts: Move fds with active true behaviour to own pollset
erts: Fix lists_member_2 reduction count
erts: Allow code_model_small to be set in xcomp setting
erts: Implement delay_send using timer instead of poll
erts: Optimize driver_set_timer(0) to fire at once
erts: Optimize the inet driver multi timers for one timer
erts: Move all inet tcp CONNECTED timers to multi timer
erts: Add erts_io_notify_port_task_executed to check_io msacc state
erts: Add pre-alloc to ALLOC msacc state
erts: Make thr prgr wakeup current or sched 1
erts: Pass thread progress data where possible
Diffstat (limited to 'erts/emulator/beam/erl_hl_timer.c')
-rw-r--r-- | erts/emulator/beam/erl_hl_timer.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/erts/emulator/beam/erl_hl_timer.c b/erts/emulator/beam/erl_hl_timer.c index 6ec6f8065e..ef7a55fa38 100644 --- a/erts/emulator/beam/erl_hl_timer.c +++ b/erts/emulator/beam/erl_hl_timer.c @@ -3041,15 +3041,23 @@ erts_set_port_timer(Port *c_prt, Sint64 tmo) check_canceled_queue(esdp, esdp->timer_service); - timeout_pos = get_timeout_pos(erts_get_monotonic_time(esdp), tmo); - - create_timer = (tmo < ERTS_TIMER_WHEEL_MSEC - ? create_tw_timer - : create_hl_timer); - tmr = (void *) create_timer(esdp, timeout_pos, 0, ERTS_TMR_PORT, - (void *) c_prt, c_prt->common.id, - THE_NON_VALUE, NULL, NULL, NULL); - erts_atomic_set_relb(&c_prt->common.timer, (erts_aint_t) tmr); + if (tmo == 0) { + erts_atomic_set_relb(&c_prt->common.timer, ERTS_PTMR_TIMEDOUT); + erts_port_task_schedule(c_prt->common.id, + &c_prt->timeout_task, + ERTS_PORT_TASK_TIMEOUT); + } else { + + timeout_pos = get_timeout_pos(erts_get_monotonic_time(esdp), tmo); + + create_timer = (tmo < ERTS_TIMER_WHEEL_MSEC + ? create_tw_timer + : create_hl_timer); + tmr = (void *) create_timer(esdp, timeout_pos, 0, ERTS_TMR_PORT, + (void *) c_prt, c_prt->common.id, + THE_NON_VALUE, NULL, NULL, NULL); + erts_atomic_set_relb(&c_prt->common.timer, (erts_aint_t) tmr); + } } void |