From f1f603c7d0b3f03dca46a4f313472288eb080eb1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 24 Dec 2014 01:10:47 +0000 Subject: making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247 --- src/transport/test_transport_testing_startstop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/transport/test_transport_testing_startstop.c') diff --git a/src/transport/test_transport_testing_startstop.c b/src/transport/test_transport_testing_startstop.c index 22a4e5148..736c635e1 100644 --- a/src/transport/test_transport_testing_startstop.c +++ b/src/transport/test_transport_testing_startstop.c @@ -32,7 +32,7 @@ */ #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) -GNUNET_SCHEDULER_TaskIdentifier timeout_task; +struct GNUNET_SCHEDULER_Task * timeout_task; static struct PeerContext *p; @@ -45,7 +45,7 @@ end () { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); - if (timeout_task != GNUNET_SCHEDULER_NO_TASK) + if (timeout_task != NULL) GNUNET_SCHEDULER_cancel (timeout_task); GNUNET_TRANSPORT_TESTING_stop_peer (tth, p); @@ -55,7 +55,7 @@ end () static void end_badly () { - timeout_task = GNUNET_SCHEDULER_NO_TASK; + timeout_task = NULL; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); if (NULL != p) @@ -100,7 +100,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (NULL == p) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n"); - if (timeout_task != GNUNET_SCHEDULER_NO_TASK) + if (timeout_task != NULL) GNUNET_SCHEDULER_cancel (timeout_task); timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); } -- cgit v1.2.3