diff --git a/include/types/global.h b/include/types/global.h index db8829567..030a553e2 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -245,6 +245,7 @@ extern int atexit_flag; extern struct thread_info { __decl_hathreads(pthread_t pthread); + __decl_hathreads(clockid_t clock_id); } thread_info[MAX_THREADS]; /* bit values to go with "warned" above */ diff --git a/src/haproxy.c b/src/haproxy.c index 742268172..692c333f0 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2497,6 +2497,11 @@ static void *run_thread_poll_loop(void *data) struct per_thread_deinit_fct *ptdf; ha_set_tid((unsigned long)data); + +#ifdef USE_THREAD + pthread_getcpuclockid(pthread_self(), &thread_info[tid].clock_id); +#endif + tv_update_date(-1,-1); /* per-thread init calls performed here are not allowed to snoop on