aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorMatt Traudt <sirmatt@ksu.edu>2017-09-13 12:54:49 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-15 11:40:59 -0400
commit8ccb2c106afa29f5c44101574775f01cd435adbf (patch)
tree00cd63785747e066443c80aa3a64caa6c1531eea /src/or
parent7f1d6430833a15a1ec806f9d17babc7d653b08ac (diff)
downloadtor-8ccb2c106afa29f5c44101574775f01cd435adbf.tar.gz
tor-8ccb2c106afa29f5c44101574775f01cd435adbf.zip
sched: rename scheduler to the_scheduler
Diffstat (limited to 'src/or')
-rw-r--r--src/or/scheduler.c48
-rw-r--r--src/or/scheduler.h2
2 files changed, 25 insertions, 25 deletions
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index b4e1aac92e..cb93f93c6f 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -148,7 +148,7 @@
* outside the scheduling system)
*****************************************************************************/
-STATIC scheduler_t *scheduler;
+STATIC scheduler_t *the_scheduler;
/*
* We keep a list of channels that are pending - i.e, have cells to write
@@ -187,12 +187,12 @@ scheduler_evt_callback(evutil_socket_t fd, short events, void *arg)
tor_assert(run_sched_ev);
/* Run the scheduler. This is a mandatory function. */
- tor_assert(scheduler->run);
- scheduler->run();
+ tor_assert(the_scheduler->run);
+ the_scheduler->run();
/* Schedule itself back in if it has more work. */
- tor_assert(scheduler->schedule);
- scheduler->schedule();
+ tor_assert(the_scheduler->schedule);
+ the_scheduler->schedule();
}
/*****************************************************************************
@@ -275,16 +275,16 @@ set_scheduler(void)
int have_kist = 0;
/* Switch, if needed */
- scheduler_t *old_scheduler = scheduler;
+ scheduler_t *old_scheduler = the_scheduler;
if (scheduler_should_use_kist()) {
- scheduler = get_kist_scheduler();
+ the_scheduler = get_kist_scheduler();
have_kist = 1;
} else {
- scheduler = get_vanilla_scheduler();
+ the_scheduler = get_vanilla_scheduler();
}
- tor_assert(scheduler);
+ tor_assert(the_scheduler);
- if (old_scheduler != scheduler) {
+ if (old_scheduler != the_scheduler) {
/* Allow the old scheduler to clean up, if needed. */
if (old_scheduler && old_scheduler->free_all) {
old_scheduler->free_all();
@@ -293,8 +293,8 @@ set_scheduler(void)
* we've allocated so we can do an easy switch back. */
/* Initialize the new scheduler. */
- if (scheduler->init) {
- scheduler->init();
+ if (the_scheduler->init) {
+ the_scheduler->init();
}
log_notice(LD_CONFIG, "Using the %s scheduler.",
have_kist ? "KIST" : "vanilla");
@@ -312,8 +312,8 @@ scheduler_conf_changed(void)
set_scheduler();
/* Then tell the (possibly new) scheduler that we have new options. */
- if (scheduler->on_new_options) {
- scheduler->on_new_options();
+ if (the_scheduler->on_new_options) {
+ the_scheduler->on_new_options();
}
}
@@ -325,8 +325,8 @@ scheduler_notify_networkstatus_changed(const networkstatus_t *old_c,
const networkstatus_t *new_c)
{
/* Then tell the (possibly new) scheduler that we have a new consensus */
- if (scheduler->on_new_consensus) {
- scheduler->on_new_consensus(old_c, new_c);
+ if (the_scheduler->on_new_consensus) {
+ the_scheduler->on_new_consensus(old_c, new_c);
}
/* Maybe the consensus param made us change the scheduler. */
set_scheduler();
@@ -356,11 +356,11 @@ scheduler_free_all(void)
channels_pending = NULL;
}
- if (scheduler && scheduler->free_all) {
- scheduler->free_all();
+ if (the_scheduler && the_scheduler->free_all) {
+ the_scheduler->free_all();
}
- tor_free(scheduler);
- scheduler = NULL;
+ tor_free(the_scheduler);
+ the_scheduler = NULL;
}
/** Mark a channel as no longer ready to accept writes */
@@ -429,7 +429,7 @@ scheduler_channel_has_waiting_cells,(channel_t *chan))
U64_PRINTF_ARG(chan->global_identifier), chan);
/* If we made a channel pending, we potentially have scheduling work to
* do. */
- scheduler->schedule();
+ the_scheduler->schedule();
} else {
/*
* It's not in waiting_for_cells, so it can't become pending; it's
@@ -487,8 +487,8 @@ scheduler_release_channel,(channel_t *chan))
offsetof(channel_t, sched_heap_idx),
chan);
}
- if (scheduler->on_channel_free) {
- scheduler->on_channel_free(chan);
+ if (the_scheduler->on_channel_free) {
+ the_scheduler->on_channel_free(chan);
}
}
@@ -520,7 +520,7 @@ scheduler_channel_wants_writes(channel_t *chan)
"to pending",
U64_PRINTF_ARG(chan->global_identifier), chan);
/* We just made a channel pending, we have scheduling work to do. */
- scheduler->schedule();
+ the_scheduler->schedule();
} else {
/*
* It's not in SCHED_CHAN_WAITING_TO_WRITE, so it can't become pending;
diff --git a/src/or/scheduler.h b/src/or/scheduler.h
index 0d82352734..68de5cf66e 100644
--- a/src/or/scheduler.h
+++ b/src/or/scheduler.h
@@ -138,7 +138,7 @@ MOCK_DECL(int, scheduler_compare_channels,
#ifdef TOR_UNIT_TESTS
extern smartlist_t *channels_pending;
extern struct event *run_sched_ev;
-extern scheduler_t *scheduler;
+extern scheduler_t *the_scheduler;
void scheduler_touch_channel(channel_t *chan);
#endif /* TOR_UNIT_TESTS */