MINOR: threads: always place the clockid in the struct thread_info

It will be easier to deal with the internal API to always have it.
This commit is contained in:
Willy Tarreau 2019-05-20 20:23:06 +02:00
parent b81939cef0
commit 624dcbf41e
2 changed files with 3 additions and 0 deletions

View File

@ -50,6 +50,7 @@ enum { tid_bit = 1UL };
enum { tid = 0 };
extern struct thread_info {
clockid_t clock_id;
/* pad to cache line (64B) */
char __pad[0]; /* unused except to check remaining room */
char __end[0] __attribute__((aligned(64)));

View File

@ -2500,6 +2500,8 @@ static void *run_thread_poll_loop(void *data)
#ifdef USE_THREAD
pthread_getcpuclockid(pthread_self(), &thread_info[tid].clock_id);
#else
thread_info[tid].clock_id = CLOCK_THREAD_CPUTIME_ID;
#endif
tv_update_date(-1,-1);