diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-24 01:10:47 +0000 |
commit | f1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch) | |
tree | 3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/testbed/gnunet-service-testbed-logger.c | |
parent | 53cd5b8eda2fa8db86b0907a62a39598981d008a (diff) | |
download | gnunet-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/testbed/gnunet-service-testbed-logger.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed-logger.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testbed/gnunet-service-testbed-logger.c b/src/testbed/gnunet-service-testbed-logger.c index 6bf33e681..7d3c834e2 100644 --- a/src/testbed/gnunet-service-testbed-logger.c +++ b/src/testbed/gnunet-service-testbed-logger.c | |||
@@ -83,7 +83,7 @@ struct GNUNET_BIO_WriteHandle *bio; | |||
83 | /** | 83 | /** |
84 | * The shutdown task handle | 84 | * The shutdown task handle |
85 | */ | 85 | */ |
86 | static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; | 86 | static struct GNUNET_SCHEDULER_Task * shutdown_task_id; |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * The number of connections we have | 89 | * The number of connections we have |
@@ -126,7 +126,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
126 | { | 126 | { |
127 | struct MessageQueue *mq_entry; | 127 | struct MessageQueue *mq_entry; |
128 | 128 | ||
129 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; | 129 | shutdown_task_id = NULL; |
130 | in_shutdown = GNUNET_YES; | 130 | in_shutdown = GNUNET_YES; |
131 | if (0 != nconn) | 131 | if (0 != nconn) |
132 | { | 132 | { |
@@ -166,7 +166,7 @@ client_disconnected (void *cls, struct GNUNET_SERVER_Client *client) | |||
166 | nconn--; | 166 | nconn--; |
167 | if (GNUNET_YES != in_shutdown) | 167 | if (GNUNET_YES != in_shutdown) |
168 | return; | 168 | return; |
169 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id); | 169 | GNUNET_assert (NULL != shutdown_task_id); |
170 | GNUNET_SCHEDULER_cancel (shutdown_task_id); | 170 | GNUNET_SCHEDULER_cancel (shutdown_task_id); |
171 | shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); | 171 | shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); |
172 | } | 172 | } |