diff options
author | Matt Traudt <sirmatt@ksu.edu> | 2017-09-21 13:15:51 -0400 |
---|---|---|
committer | Matt Traudt <sirmatt@ksu.edu> | 2017-09-22 08:51:22 -0400 |
commit | 22699e3f166f4c20ea0727cef9b20b936bb3ac7c (patch) | |
tree | 37e63e62966c2585f99dc93b0abdcf795f64af0a /src/or/scheduler.h | |
parent | 00d7b60557883ac0c3ad4c27071d4efe1f7a3ffb (diff) | |
download | tor-22699e3f166f4c20ea0727cef9b20b936bb3ac7c.tar.gz tor-22699e3f166f4c20ea0727cef9b20b936bb3ac7c.zip |
sched: only log when scheduler type changes
Closes 23552. Thanks dgoulet for original impl
Diffstat (limited to 'src/or/scheduler.h')
-rw-r--r-- | src/or/scheduler.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/or/scheduler.h b/src/or/scheduler.h index 93da1c904e..f740230b1e 100644 --- a/src/or/scheduler.h +++ b/src/or/scheduler.h @@ -13,7 +13,17 @@ #include "channel.h" #include "testsupport.h" -/* +/** Scheduler type, we build an ordered list with those values from the + * parsed strings in Schedulers. The reason to do such a thing is so we can + * quickly and without parsing strings select the scheduler at anytime. */ +typedef enum { + SCHEDULER_NONE = -1, + SCHEDULER_VANILLA = 1, + SCHEDULER_KIST = 2, + SCHEDULER_KIST_LITE = 3, +} scheduler_types_t; + +/** * A scheduler implementation is a collection of function pointers. If you * would like to add a new scheduler called foo, create scheduler_foo.c, * implement at least the mandatory ones, and implement get_foo_scheduler() @@ -31,6 +41,10 @@ * is shutting down), then set that function pointer to NULL. */ typedef struct scheduler_s { + /* Scheduler type. This is used for logging when the scheduler is switched + * during runtime. */ + scheduler_types_t type; + /* (Optional) To be called when we want to prepare a scheduler for use. * Perhaps Tor just started and we are the lucky chosen scheduler, or * perhaps Tor is switching to this scheduler. No matter the case, this is @@ -82,15 +96,6 @@ typedef struct scheduler_s { void (*on_new_options)(void); } scheduler_t; -/** Scheduler type, we build an ordered list with those values from the - * parsed strings in Schedulers. The reason to do such a thing is so we can - * quickly and without parsing strings select the scheduler at anytime. */ -typedef enum { - SCHEDULER_VANILLA = 1, - SCHEDULER_KIST = 2, - SCHEDULER_KIST_LITE = 3, -} scheduler_types_t; - /***************************************************************************** * Globally visible scheduler variables/values * |