Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
tls: fix wrong usage of session close function issue
[vpp.git]
/
src
/
vppinfra
/
tw_timer_template.c
diff --git
a/src/vppinfra/tw_timer_template.c
b/src/vppinfra/tw_timer_template.c
index
af2b75a
..
174ffac
100644
(file)
--- a/
src/vppinfra/tw_timer_template.c
+++ b/
src/vppinfra/tw_timer_template.c
@@
-513,7
+513,7
@@
static inline
u32 slow_wheel_index __attribute__ ((unused));
u32 glacier_wheel_index __attribute__ ((unused));
u32 slow_wheel_index __attribute__ ((unused));
u32 glacier_wheel_index __attribute__ ((unused));
- /*
Shouldn't happen
*/
+ /*
Called too soon to process new timer expirations?
*/
if (PREDICT_FALSE (now < tw->next_run_time))
return callback_vector_arg;
if (PREDICT_FALSE (now < tw->next_run_time))
return callback_vector_arg;
@@
-525,6
+525,14
@@
static inline
/* Remember when we ran, compute next runtime */
tw->next_run_time = (now + tw->timer_interval);
/* Remember when we ran, compute next runtime */
tw->next_run_time = (now + tw->timer_interval);
+ /* First call, or time jumped backwards? */
+ if (PREDICT_FALSE
+ ((tw->last_run_time == 0.0) || (now <= tw->last_run_time)))
+ {
+ tw->last_run_time = now;
+ return callback_vector_arg;
+ }
+
if (callback_vector_arg == 0)
{
_vec_len (tw->expired_timer_handles) = 0;
if (callback_vector_arg == 0)
{
_vec_len (tw->expired_timer_handles) = 0;