]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: time/ticks: move now_ms and global_now_ms definitions to ticks.h
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Oct 2021 14:03:19 +0000 (16:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Oct 2021 23:41:14 +0000 (01:41 +0200)
These are ticks, not timeval, and they're a cause for plenty of files
including time.h just to access now_ms that's only used with ticks
functions. Let's move them over there.

include/haproxy/ticks.h
include/haproxy/time.h

index 52344ae256107c942d03a77584174351d2fa0030..8b8fcc632cdee509411d35537375d412413faed7 100644 (file)
 #define MS_TO_TICKS(ms) (ms)
 #define TICKS_TO_MS(tk) (tk)
 
+/* currently updated and stored in time.c */
+extern THREAD_LOCAL unsigned int   now_ms;   /* internal date in milliseconds (may wrap) */
+extern volatile unsigned int global_now_ms;
+
 /* return 1 if tick is set, otherwise 0 */
 static inline int tick_isset(int expire)
 {
index 436b1a8a099f0ee81e08d37619ab4f62b8b4a874..bcba0f8f946770263fd7d975dd8ac844b0639e99 100644 (file)
 #define MINTIME(old, new)      (((new)<0)?(old):(((old)<0||(new)<(old))?(new):(old)))
 #define SETNOW(a)              (*a=now)
 
-extern THREAD_LOCAL unsigned int   now_ms;           /* internal date in milliseconds (may wrap) */
 extern THREAD_LOCAL struct timeval now;              /* internal date is a monotonic function of real clock */
 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;
-extern volatile unsigned int global_now_ms;
 
 
 /**** exported functions *************************************************/