]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: wdt: fall back to CLOCK_REALTIME if CLOCK_THREAD_CPUTIME is not available
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 09:48:18 +0000 (10:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 11:02:27 +0000 (12:02 +0100)
commitd6f19665434234f27916e550826a9bb62928064b
treebdf9e8e6655ae2f6ddc4f0f189e4957c017d0076
parentc0bbdc196ded7b6d28221ca9b96f0cf8b41203ab
MEDIUM: wdt: fall back to CLOCK_REALTIME if CLOCK_THREAD_CPUTIME is not available

At least FreeBSD has a fully functional CLOCK_THREAD_CPUTIME but it
cannot create a timer on it. This is not a problem since our timer is
only used to measure each thread's usage using now_cpu_time_thread().
So by just replacing this clock with CLOCK_REALTIME we allow such
platforms to periodically call the wdt and check the thread's CPU usage.
The consequence is that even on a totally idle system there will still
be a few extra periodic wakeups, but the watchdog becomes usable there
as well.
src/wdt.c