]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: threads: add a timer_t per thread in thread_info
authorWilly Tarreau <w@1wt.eu>
Tue, 21 May 2019 18:01:26 +0000 (20:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 09:50:48 +0000 (11:50 +0200)
commit430f590b5b652c0cbc9e31155e2678ea4a2d884a
treed9955ea624dad19374645539ffed8f3fdfc80073
parente6a02fa65afeedc4cd3c9668c036b9c69ec15fed
MINOR: threads: add a timer_t per thread in thread_info

This will be used by the watchdog to detect that a thread locked up.
It's only defined on platforms supporting it. This patch only reserves
the room for the timer in the struct. A special value was reserved for
the uninitialized timer. The problem is that the POSIX API was horribly
designed, defining no invalid value, thus for each timer it is required
to keep a second variable to indicate whether it's valid. A quick check
shows that defining a 32-bit invalid value is not something uncommon
across other implementations, with ~0 being common. Let's try with this
and if it causes issues we can revisit this decision.
include/common/compat.h
include/common/hathreads.h