mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
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:
parent
b81939cef0
commit
624dcbf41e
@ -50,6 +50,7 @@ enum { tid_bit = 1UL };
|
|||||||
enum { tid = 0 };
|
enum { tid = 0 };
|
||||||
|
|
||||||
extern struct thread_info {
|
extern struct thread_info {
|
||||||
|
clockid_t clock_id;
|
||||||
/* pad to cache line (64B) */
|
/* pad to cache line (64B) */
|
||||||
char __pad[0]; /* unused except to check remaining room */
|
char __pad[0]; /* unused except to check remaining room */
|
||||||
char __end[0] __attribute__((aligned(64)));
|
char __end[0] __attribute__((aligned(64)));
|
||||||
|
@ -2500,6 +2500,8 @@ static void *run_thread_poll_loop(void *data)
|
|||||||
|
|
||||||
#ifdef USE_THREAD
|
#ifdef USE_THREAD
|
||||||
pthread_getcpuclockid(pthread_self(), &thread_info[tid].clock_id);
|
pthread_getcpuclockid(pthread_self(), &thread_info[tid].clock_id);
|
||||||
|
#else
|
||||||
|
thread_info[tid].clock_id = CLOCK_THREAD_CPUTIME_ID;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tv_update_date(-1,-1);
|
tv_update_date(-1,-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user