aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_hl_timer.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-12-06 11:53:18 +0100
committerLukas Larsson <[email protected]>2018-12-06 11:53:18 +0100
commitea7d6c39f2179b2240d55df4a1ddd515b6d32832 (patch)
tree117436f49db44ee51a9b28c0cf94e094c31ed280 /erts/emulator/beam/erl_hl_timer.c
parent551e15331967551307b1618248334b20dce3241c (diff)
parent73e4f5f21bbf492ab61c01dee48fa09fd7309a50 (diff)
downloadotp-ea7d6c39f2179b2240d55df4a1ddd515b6d32832.tar.gz
otp-ea7d6c39f2179b2240d55df4a1ddd515b6d32832.tar.bz2
otp-ea7d6c39f2179b2240d55df4a1ddd515b6d32832.zip
Merge branch 'maint'
Conflicts: erts/emulator/beam/erl_process.c
Diffstat (limited to 'erts/emulator/beam/erl_hl_timer.c')
-rw-r--r--erts/emulator/beam/erl_hl_timer.c26
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