main: Update periodic events comment based on latest code

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2018-04-18 10:25:39 -04:00
parent f70fa67da6
commit 87cb9ce900

View File

@ -1523,8 +1523,8 @@ teardown_periodic_events(void)
periodic_events_initialized = 0; periodic_events_initialized = 0;
} }
/** Do a pass at all our periodic events, destroy those we don't need anymore /** Do a pass at all our periodic events, disable those we don't need anymore
* and enabled those we need now using the given options. */ * and enable those we need now using the given options. */
static void static void
rescan_periodic_events(const or_options_t *options) rescan_periodic_events(const or_options_t *options)
{ {
@ -1547,15 +1547,15 @@ rescan_periodic_events(const or_options_t *options)
} }
} }
/* We just got new options globally set, see if we need to destroy or setup /* We just got new options globally set, see if we need to enabled or disable
* periodic events. */ * periodic events. */
void void
periodic_events_on_new_options(const or_options_t *options) periodic_events_on_new_options(const or_options_t *options)
{ {
/* Only if we've already initialized once the events, teardown them all and /* Only if we've already initialized the events, rescan the list which will
* reinitialize. It is just simpler that way instead of going through all * enable or disable events depending on our roles. This will be called at
* currently enabled events and trying to destroy only the one that could be * bootup and we don't want this function to initialize the events because
* affected. */ * they aren't set up at this stage. */
if (periodic_events_initialized) { if (periodic_events_initialized) {
rescan_periodic_events(options); rescan_periodic_events(options);
} }