]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: threads: add each thread's clockid into the global thread_info
authorWilly Tarreau <w@1wt.eu>
Fri, 3 May 2019 15:21:18 +0000 (17:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 20 May 2019 09:42:25 +0000 (11:42 +0200)
commit91e6df01fabf74884b95728171d54d68da228d19
treeff959de91094029cc7bfdbbcfbcf781b999cd5ba
parent522cfbc1ea86b1baf54856ba8908eb313a162cbe
MINOR: threads: add each thread's clockid into the global thread_info

This is the per-thread CPU runtime clock, it will be used to measure
the CPU usage of each thread and by the lockup detection mechanism. It
must only be retrieved at the beginning of run_thread_poll_loop() since
the thread must already have been started for this. But it must be done
before performing any per-thread initcall so that all thread init
functions have access to the clock ID.

Note that it could make sense to always have this clockid available even
in non-threaded situations and place the process' clock there instead.
But it would add portability issues which are currently easy to deal
with by disabling threads so it may not be worth it for now.
include/types/global.h
src/haproxy.c