diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
commit | f1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch) | |
tree | 3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/nse/gnunet-nse-profiler.c | |
parent | 53cd5b8eda2fa8db86b0907a62a39598981d008a (diff) | |
download | gnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.tar.gz gnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.zip |
making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247
Diffstat (limited to 'src/nse/gnunet-nse-profiler.c')
-rw-r--r-- | src/nse/gnunet-nse-profiler.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index 3e39056be..bdba7bbaf 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c | |||
@@ -179,7 +179,7 @@ static struct GNUNET_CONFIGURATION_Handle *testing_cfg; | |||
179 | /** | 179 | /** |
180 | * The shutdown task | 180 | * The shutdown task |
181 | */ | 181 | */ |
182 | static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; | 182 | static struct GNUNET_SCHEDULER_Task * shutdown_task_id; |
183 | 183 | ||
184 | /** | 184 | /** |
185 | * Maximum number of connections to NSE services. | 185 | * Maximum number of connections to NSE services. |
@@ -270,7 +270,7 @@ close_monitor_connections () | |||
270 | static void | 270 | static void |
271 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 271 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
272 | { | 272 | { |
273 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; | 273 | shutdown_task_id = NULL; |
274 | if (GNUNET_YES == shutting_down) | 274 | if (GNUNET_YES == shutting_down) |
275 | return; | 275 | return; |
276 | shutting_down = GNUNET_YES; | 276 | shutting_down = GNUNET_YES; |
@@ -298,7 +298,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
298 | static void | 298 | static void |
299 | shutdown_now () | 299 | shutdown_now () |
300 | { | 300 | { |
301 | if (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id) | 301 | if (NULL != shutdown_task_id) |
302 | GNUNET_SCHEDULER_cancel (shutdown_task_id); | 302 | GNUNET_SCHEDULER_cancel (shutdown_task_id); |
303 | shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); | 303 | shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); |
304 | } | 304 | } |