MINOR: poller: move the call of tv_update_date() back to the pollers

The reason behind this will be to be able to compute a timeout when
busy polling.
This commit is contained in:
Willy Tarreau 2018-11-22 18:57:37 +01:00
parent 744a08903e
commit 48f8bc1368
5 changed files with 4 additions and 1 deletions

View File

@ -586,7 +586,6 @@ static inline void tv_entering_poll()
*/
static inline void tv_leaving_poll(int timeout, int interrupted)
{
tv_update_date(timeout, interrupted);
measure_idle();
prev_cpu_time = now_cpu_time();
prev_mono_time = now_mono_time();

View File

@ -150,6 +150,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
tv_entering_poll();
activity_count_runtime();
status = epoll_wait(epoll_fd[tid], epoll_events, global.tune.maxpollevents, wait_time);
tv_update_date(wait_time, status);
tv_leaving_poll(wait_time, status);
thread_harmless_end();

View File

@ -143,6 +143,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
kev, // struct kevent *eventlist
fd, // int nevents
&timeout); // const struct timespec *timeout
tv_update_date(delta_ms, status);
tv_leaving_poll(delta_ms, status);
thread_harmless_end();

View File

@ -198,6 +198,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
tv_entering_poll();
activity_count_runtime();
status = poll(poll_events, nbfd, wait_time);
tv_update_date(wait_time, status);
tv_leaving_poll(wait_time, status);
thread_harmless_end();

View File

@ -172,6 +172,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
writenotnull ? tmp_evts[DIR_WR] : NULL,
NULL,
&delta);
tv_update_date(delta_ms, status);
tv_leaving_poll(delta_ms, status);
thread_harmless_end();