mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
MINOR: clock: add clock_get_now_offset() helper
Same as clock_set_now_offset() but to retrieve the offset from external location.
This commit is contained in:
parent
20f9d8fa4e
commit
c8282f6138
@ -50,6 +50,7 @@ void clock_leaving_poll(int timeout, int interrupted);
|
||||
void clock_entering_poll(void);
|
||||
void clock_adjust_now_offset(void);
|
||||
void clock_set_now_offset(llong ofs);
|
||||
llong clock_get_now_offset(void);
|
||||
|
||||
static inline void clock_update_date(int max_wait, int interrupted)
|
||||
{
|
||||
|
@ -369,6 +369,11 @@ void clock_set_now_offset(llong ofs)
|
||||
HA_ATOMIC_STORE(&now_offset, ofs);
|
||||
}
|
||||
|
||||
llong clock_get_now_offset(void)
|
||||
{
|
||||
return HA_ATOMIC_LOAD(&now_offset);
|
||||
}
|
||||
|
||||
/* must be called once per thread to initialize their thread-local variables.
|
||||
* Note that other threads might also be initializing and running in parallel.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user