diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-09-29 17:46:50 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-29 17:46:50 -0400 |
commit | dddae36f5e0e9e088cd9aa98c6e4a6c904e1efa4 (patch) | |
tree | 8941c3d6985055f38aeafd34ced7ad30d5a8edea /src | |
parent | 9ae18b8a91b6706d0da1db730269ff7c12e7e7a3 (diff) | |
parent | 070064de899901daaf98aefc3335bc9f21acb5c6 (diff) | |
download | tor-dddae36f5e0e9e088cd9aa98c6e4a6c904e1efa4.tar.gz tor-dddae36f5e0e9e088cd9aa98c6e4a6c904e1efa4.zip |
Merge remote-tracking branch 'dgoulet/ticket23696_032_01'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/scheduler_kist.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c index 2dddd3e9a4..d269fb49b8 100644 --- a/src/or/scheduler_kist.c +++ b/src/or/scheduler_kist.c @@ -490,6 +490,16 @@ kist_scheduler_on_new_options(void) static void kist_scheduler_init(void) { + /* When initializing the scheduler, the last run could be 0 because it is + * declared static or a value in the past that was set when it was last + * used. In both cases, we want to initialize it to now so we don't risk + * using the value 0 which doesn't play well with our monotonic time + * interface. + * + * One side effect is that the first scheduler run will be at the next tick + * that is in now + 10 msec (KIST_SCHED_RUN_INTERVAL_DEFAULT) by default. */ + monotime_get(&scheduler_last_run); + kist_scheduler_on_new_options(); IF_BUG_ONCE(sched_run_interval == 0) { log_warn(LD_SCHED, "We are initing the KIST scheduler and noticed the " |