]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads: always place the clockid in the struct thread_info
authorWilly Tarreau <w@1wt.eu>
Mon, 20 May 2019 18:23:06 +0000 (20:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 20 May 2019 19:13:01 +0000 (21:13 +0200)
It will be easier to deal with the internal API to always have it.

include/common/hathreads.h
src/haproxy.c

index 0dbec671d7a8f8b9640460df84f8f5f597a40304..6c420dd3fa6971a6a2c0cf076afbf9523ed89c1f 100644 (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)));
index 692c333f0bb5083cd8f603aec1f3ce5f18245bb1..1c5898e935318b16582978bd1e95a80cc001dc8a 100644 (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);