diff options
author | David Goulet <dgoulet@torproject.org> | 2017-09-14 14:47:59 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-09-15 11:40:59 -0400 |
commit | 734dbfa590baf560741f0754bd81c07dfb829485 (patch) | |
tree | 4cf32837fd3823ac53b4244e6aab794a4a6eec46 /src/test/test_scheduler.c | |
parent | bd34a0d30f754f3dd75199d915febe918d058f30 (diff) | |
download | tor-734dbfa590baf560741f0754bd81c07dfb829485.tar.gz tor-734dbfa590baf560741f0754bd81c07dfb829485.zip |
sched: Make the scheduler object static
Each type of scheduler implements its own static scheduler_t object and
returns a reference to it.
This commit also makes it a const pointer that is it can only change inside
the scheduler type subsystem but not outside for extra protection.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_scheduler.c')
-rw-r--r-- | src/test/test_scheduler.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c index 0cc6d88dbb..633a089227 100644 --- a/src/test/test_scheduler.c +++ b/src/test/test_scheduler.c @@ -408,7 +408,7 @@ perform_channel_state_tests(int KISTSchedRunInterval) * Disable scheduler_run so we can just check the state transitions * without having to make everything it might call work too. */ - the_scheduler->run = scheduler_run_noop_mock; + ((scheduler_t *) the_scheduler)->run = scheduler_run_noop_mock; tt_int_op(smartlist_len(channels_pending), OP_EQ, 0); @@ -617,7 +617,7 @@ test_scheduler_loop_vanilla(void *arg) * without having to make everything it might call work too. */ run_func_ptr = the_scheduler->run; - the_scheduler->run = scheduler_run_noop_mock; + ((scheduler_t *) the_scheduler)->run = scheduler_run_noop_mock; tt_int_op(smartlist_len(channels_pending), OP_EQ, 0); |