]> git.ipfire.org Git - thirdparty/haproxy.git/commit
REORG: time: move time-keeping code and variables to clock.c
authorWilly Tarreau <w@1wt.eu>
Fri, 8 Oct 2021 07:33:24 +0000 (09:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Oct 2021 15:22:26 +0000 (17:22 +0200)
commit5554264f314578a3576ba08825c1158b6c4c96a2
tree78cb0ac83135f35b303f01366025161d14a12e50
parent28345c66527cebb80d8639130566750a366a29a2
REORG: time: move time-keeping code and variables to clock.c

There is currently a problem related to time keeping. We're mixing
the functions to perform calculations with the os-dependent code
needed to retrieve and adjust the local time.

This patch extracts from time.{c,h} the parts that are solely dedicated
to time keeping. These are the "now" or "before_poll" variables for
example, as well as the various now_*() functions that make use of
gettimeofday() and clock_gettime() to retrieve the current time.

The "tv_*" functions moved there were also more appropriately renamed
to "clock_*".

Other parts used to compute stolen time are in other files, they will
have to be picked next.
24 files changed:
Makefile
addons/ot/include/include.h
include/haproxy/backend.h
include/haproxy/clock.h [new file with mode: 0644]
include/haproxy/task.h
include/haproxy/time.h
src/activity.c
src/cfgparse.c
src/clock.c [new file with mode: 0644]
src/debug.c
src/ev_epoll.c
src/ev_evports.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c
src/haproxy.c
src/hlua.c
src/log.c
src/sample.c
src/stats.c
src/task.c
src/thread.c
src/time.c
src/wdt.c