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/regex/gnunet-regex-simulation-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/regex/gnunet-regex-simulation-profiler.c')
-rw-r--r-- | src/regex/gnunet-regex-simulation-profiler.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c index f00108011..9c2567895 100644 --- a/src/regex/gnunet-regex-simulation-profiler.c +++ b/src/regex/gnunet-regex-simulation-profiler.c | |||
@@ -91,17 +91,17 @@ static struct ProgressMeter *meter; | |||
91 | /** | 91 | /** |
92 | * Abort task identifier. | 92 | * Abort task identifier. |
93 | */ | 93 | */ |
94 | static GNUNET_SCHEDULER_TaskIdentifier abort_task; | 94 | static struct GNUNET_SCHEDULER_Task * abort_task; |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * Shutdown task identifier. | 97 | * Shutdown task identifier. |
98 | */ | 98 | */ |
99 | static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; | 99 | static struct GNUNET_SCHEDULER_Task * shutdown_task; |
100 | 100 | ||
101 | /** | 101 | /** |
102 | * Scan task identifier; | 102 | * Scan task identifier; |
103 | */ | 103 | */ |
104 | static GNUNET_SCHEDULER_TaskIdentifier scan_task; | 104 | static struct GNUNET_SCHEDULER_Task * scan_task; |
105 | 105 | ||
106 | /** | 106 | /** |
107 | * Global testing status. | 107 | * Global testing status. |
@@ -276,8 +276,8 @@ free_meter (struct ProgressMeter *meter) | |||
276 | static void | 276 | static void |
277 | do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 277 | do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
278 | { | 278 | { |
279 | shutdown_task = GNUNET_SCHEDULER_NO_TASK; | 279 | shutdown_task = NULL; |
280 | if (GNUNET_SCHEDULER_NO_TASK != abort_task) | 280 | if (NULL != abort_task) |
281 | GNUNET_SCHEDULER_cancel (abort_task); | 281 | GNUNET_SCHEDULER_cancel (abort_task); |
282 | if (NULL != mysql_ctx) | 282 | if (NULL != mysql_ctx) |
283 | GNUNET_MYSQL_context_destroy (mysql_ctx); | 283 | GNUNET_MYSQL_context_destroy (mysql_ctx); |
@@ -298,9 +298,9 @@ static void | |||
298 | do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 298 | do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
299 | { | 299 | { |
300 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); | 300 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); |
301 | abort_task = GNUNET_SCHEDULER_NO_TASK; | 301 | abort_task = NULL; |
302 | GNUNET_SCHEDULER_cancel (scan_task); | 302 | GNUNET_SCHEDULER_cancel (scan_task); |
303 | scan_task = GNUNET_SCHEDULER_NO_TASK; | 303 | scan_task = NULL; |
304 | result = GNUNET_SYSERR; | 304 | result = GNUNET_SYSERR; |
305 | GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); | 305 | GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); |
306 | } | 306 | } |