diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-25 14:20:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-30 11:14:59 -0400 |
commit | 6eb1b8da0ab2a58157c4eb7db0a8471cb9dfefda (patch) | |
tree | 6b2f32d0d63040152eb8adf8e1a461de9ef1843f /src/test/test_periodic_event.c | |
parent | 0d650e7958d011dc165fbad7477e2eff842598ea (diff) | |
download | tor-6eb1b8da0ab2a58157c4eb7db0a8471cb9dfefda.tar.gz tor-6eb1b8da0ab2a58157c4eb7db0a8471cb9dfefda.zip |
Turn 'mainloop' into a subsystem.
We need a little refactoring for this to work, since the
initialization code for the periodic events assumes that libevent is
already initialized, which it can't be until it's configured.
This change, combined with the previous ones, lets other subsystems
declare their own periodic events, without mainloop.c having to know
about them. Implements ticket 30293.
Diffstat (limited to 'src/test/test_periodic_event.c')
-rw-r--r-- | src/test/test_periodic_event.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/test_periodic_event.c b/src/test/test_periodic_event.c index 645274d371..19325ed3b7 100644 --- a/src/test/test_periodic_event.c +++ b/src/test/test_periodic_event.c @@ -51,6 +51,7 @@ test_pe_initialize(void *arg) * need to run the main loop and then wait for a second delaying the unit * tests. Instead, we'll test the callback work indepedently elsewhere. */ initialize_periodic_events(); + periodic_events_setup_all(); set_network_participation(false); rescan_periodic_events(get_options()); @@ -110,6 +111,7 @@ test_pe_launch(void *arg) #endif initialize_periodic_events(); + periodic_events_setup_all(); /* Now that we've initialized, rescan the list to launch. */ periodic_events_on_new_options(options); @@ -300,6 +302,7 @@ test_pe_hs_service(void *arg) consider_hibernation(time(NULL)); /* Initialize the events so we can enable them */ initialize_periodic_events(); + periodic_events_setup_all(); /* Hack: We'll set a dumb fn() of each events so they don't get called when * dispatching them. We just want to test the state of the callbacks, not |