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/testing/gnunet-testing.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/testing') diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c index a79e836c7..2db2fd737 100644 --- a/src/testing/gnunet-testing.c +++ b/src/testing/gnunet-testing.c @@ -76,7 +76,7 @@ static char *tmpfilename; /** * Task identifier of the task that waits for stdin. */ -static GNUNET_SCHEDULER_TaskIdentifier tid; +static struct GNUNET_SCHEDULER_Task * tid; /** * Peer started for '-r'. @@ -207,10 +207,10 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (0 != UNLINK (tmpfilename)) GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", tmpfilename); } - if (GNUNET_SCHEDULER_NO_TASK != tid) + if (NULL != tid) { GNUNET_SCHEDULER_cancel (tid); - tid = GNUNET_SCHEDULER_NO_TASK; + tid = NULL; } if (NULL != fh) { @@ -231,7 +231,7 @@ stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { int c; - tid = GNUNET_SCHEDULER_NO_TASK; + tid = NULL; if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) return; GNUNET_assert (0 != (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason)); -- cgit v1.2.3