aboutsummaryrefslogtreecommitdiff
path: root/src/core/test_core_api_send_to_self.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/core/test_core_api_send_to_self.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/core/test_core_api_send_to_self.c')
-rw-r--r--src/core/test_core_api_send_to_self.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c
index 913ae3848..f5ed7453c 100644
--- a/src/core/test_core_api_send_to_self.c
+++ b/src/core/test_core_api_send_to_self.c
@@ -38,7 +38,7 @@ static int ret;
38/** 38/**
39 * Handle to the cleanup task. 39 * Handle to the cleanup task.
40 */ 40 */
41GNUNET_SCHEDULER_TaskIdentifier die_task; 41struct GNUNET_SCHEDULER_Task * die_task;
42 42
43/** 43/**
44 * Identity of this peer. 44 * Identity of this peer.
@@ -57,7 +57,7 @@ struct GNUNET_CORE_Handle *core;
57static void 57static void
58cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx) 58cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx)
59{ 59{
60 die_task = GNUNET_SCHEDULER_NO_TASK; 60 die_task = NULL;
61 61
62 if (core != NULL) 62 if (core != NULL)
63 { 63 {
@@ -73,7 +73,7 @@ static int
73receive (void *cls, const struct GNUNET_PeerIdentity *other, 73receive (void *cls, const struct GNUNET_PeerIdentity *other,
74 const struct GNUNET_MessageHeader *message) 74 const struct GNUNET_MessageHeader *message)
75{ 75{
76 if (die_task != GNUNET_SCHEDULER_NO_TASK) 76 if (die_task != NULL)
77 GNUNET_SCHEDULER_cancel (die_task); 77 GNUNET_SCHEDULER_cancel (die_task);
78 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from peer %s\n", 78 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from peer %s\n",
79 GNUNET_i2s (other)); 79 GNUNET_i2s (other));