aboutsummaryrefslogtreecommitdiff
path: root/src/ats/test_ats_api_performance_monitor.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
commitf1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch)
tree3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/ats/test_ats_api_performance_monitor.c
parent53cd5b8eda2fa8db86b0907a62a39598981d008a (diff)
downloadgnunet-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_api_performance_monitor.c')
-rw-r--r--src/ats/test_ats_api_performance_monitor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ats/test_ats_api_performance_monitor.c b/src/ats/test_ats_api_performance_monitor.c
index 4b6b08b74..0c17ded87 100644
--- a/src/ats/test_ats_api_performance_monitor.c
+++ b/src/ats/test_ats_api_performance_monitor.c
@@ -31,7 +31,7 @@
31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
32#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 32#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
33 33
34static GNUNET_SCHEDULER_TaskIdentifier die_task; 34static struct GNUNET_SCHEDULER_Task * die_task;
35 35
36/** 36/**
37 * Statistics handle 37 * Statistics handle
@@ -167,7 +167,7 @@ address_suggest_cb (void *cls,
167static void 167static void
168end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 168end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
169{ 169{
170 die_task = GNUNET_SCHEDULER_NO_TASK; 170 die_task = NULL;
171 end ( NULL, NULL); 171 end ( NULL, NULL);
172 ret = GNUNET_SYSERR; 172 ret = GNUNET_SYSERR;
173} 173}
@@ -176,10 +176,10 @@ static void
176end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 176end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
177{ 177{
178 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 178 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
179 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 179 if (die_task != NULL )
180 { 180 {
181 GNUNET_SCHEDULER_cancel (die_task); 181 GNUNET_SCHEDULER_cancel (die_task);
182 die_task = GNUNET_SCHEDULER_NO_TASK; 182 die_task = NULL;
183 } 183 }
184 184
185 if (NULL != sched_ats) 185 if (NULL != sched_ats)