summaryrefslogtreecommitdiff
path: root/src/transport/test_transport_testing_startstop.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/transport/test_transport_testing_startstop.c
parent53cd5b8eda2fa8db86b0907a62a39598981d008a (diff)
making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247
Diffstat (limited to 'src/transport/test_transport_testing_startstop.c')
-rw-r--r--src/transport/test_transport_testing_startstop.c8
1 files changed, 4 insertions, 4 deletions
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);
}