]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: time: export the global_now variable
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Mar 2021 17:52:18 +0000 (18:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Mar 2021 18:25:47 +0000 (19:25 +0100)
This is the process-wide monotonic time that is used to update each
thread's own time. It may be required at a few places where a strictly
monotonic clock is required such as freq_ctr. It will be have to be
backported as a dependency of a forthcoming fix.

include/haproxy/time.h
src/time.c

index 0fba2cc4336885bdeb8e19b498c8f4a54b2104d6..87bc3655a44afa36c28fa3d0863e7f1a491cfe76 100644 (file)
@@ -60,6 +60,7 @@ extern THREAD_LOCAL struct timeval date;             /* the real current date */
 extern struct timeval start_date;       /* the process's start date */
 extern THREAD_LOCAL struct timeval before_poll;      /* system date before calling poll() */
 extern THREAD_LOCAL struct timeval after_poll;       /* system date after leaving poll() */
+extern volatile unsigned long long global_now;
 
 
 /**** exported functions *************************************************/
index a665a85b1948dce16901159a69897a47ce465fb3..d5344d26f62319220afdb6e740d439156c9d9d0c 100644 (file)
@@ -28,7 +28,7 @@ THREAD_LOCAL struct timeval before_poll;     /* system date before calling poll(
 THREAD_LOCAL struct timeval after_poll;      /* system date after leaving poll() */
 
 static THREAD_LOCAL struct timeval tv_offset;  /* per-thread time ofsset relative to global time */
-static volatile unsigned long long global_now; /* common date between all threads (32:32) */
+volatile unsigned long long global_now;      /* common date between all threads (32:32) */
 
 static THREAD_LOCAL unsigned int iso_time_sec;     /* last iso time value for this thread */
 static THREAD_LOCAL char         iso_time_str[34]; /* ISO time representation of gettimeofday() */