MINOR: time: export the global_now variable

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.
This commit is contained in:
Willy Tarreau 2021-03-17 18:52:18 +01:00
parent 59b2925733
commit 650f374f24
2 changed files with 2 additions and 1 deletions

View 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 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 before_poll; /* system date before calling poll() */
extern THREAD_LOCAL struct timeval after_poll; /* system date after leaving poll() */ extern THREAD_LOCAL struct timeval after_poll; /* system date after leaving poll() */
extern volatile unsigned long long global_now;
/**** exported functions *************************************************/ /**** exported functions *************************************************/

View 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() */ 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 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 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() */ static THREAD_LOCAL char iso_time_str[34]; /* ISO time representation of gettimeofday() */