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/ats/test_ats_solver_preferences.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/ats/test_ats_solver_preferences.c')
-rw-r--r-- | src/ats/test_ats_solver_preferences.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ats/test_ats_solver_preferences.c b/src/ats/test_ats_solver_preferences.c index 4de3d9a5b..946cb5476 100644 --- a/src/ats/test_ats_solver_preferences.c +++ b/src/ats/test_ats_solver_preferences.c | |||
@@ -38,7 +38,7 @@ | |||
38 | /** | 38 | /** |
39 | * Timeout task | 39 | * Timeout task |
40 | */ | 40 | */ |
41 | static GNUNET_SCHEDULER_TaskIdentifier die_task; | 41 | static struct GNUNET_SCHEDULER_Task * die_task; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Statistics handle | 44 | * Statistics handle |
@@ -99,10 +99,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
99 | { | 99 | { |
100 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Done!\n"); | 100 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Done!\n"); |
101 | 101 | ||
102 | if (die_task != GNUNET_SCHEDULER_NO_TASK ) | 102 | if (die_task != NULL ) |
103 | { | 103 | { |
104 | GNUNET_SCHEDULER_cancel (die_task); | 104 | GNUNET_SCHEDULER_cancel (die_task); |
105 | die_task = GNUNET_SCHEDULER_NO_TASK; | 105 | die_task = NULL; |
106 | } | 106 | } |
107 | 107 | ||
108 | if (NULL != sched_ats) | 108 | if (NULL != sched_ats) |
@@ -132,7 +132,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
132 | static void | 132 | static void |
133 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 133 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
134 | { | 134 | { |
135 | die_task = GNUNET_SCHEDULER_NO_TASK; | 135 | die_task = NULL; |
136 | end (NULL, NULL ); | 136 | end (NULL, NULL ); |
137 | ret = GNUNET_SYSERR; | 137 | ret = GNUNET_SYSERR; |
138 | } | 138 | } |