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.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.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index a1d6aed09..039e0d346 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -132,7 +132,7 @@ static struct MessageQueue *mq_tail; | |||
132 | /** | 132 | /** |
133 | * The shutdown task handle | 133 | * The shutdown task handle |
134 | */ | 134 | */ |
135 | static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; | 135 | static struct GNUNET_SCHEDULER_Task * shutdown_task_id; |
136 | 136 | ||
137 | 137 | ||
138 | /** | 138 | /** |
@@ -736,7 +736,7 @@ GST_clear_fopcq () | |||
736 | { | 736 | { |
737 | GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fopc); | 737 | GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fopc); |
738 | GNUNET_TESTBED_forward_operation_msg_cancel_ (fopc->opc); | 738 | GNUNET_TESTBED_forward_operation_msg_cancel_ (fopc->opc); |
739 | if (GNUNET_SCHEDULER_NO_TASK != fopc->timeout_task) | 739 | if (NULL != fopc->timeout_task) |
740 | GNUNET_SCHEDULER_cancel (fopc->timeout_task); | 740 | GNUNET_SCHEDULER_cancel (fopc->timeout_task); |
741 | GNUNET_SERVER_client_drop (fopc->client); | 741 | GNUNET_SERVER_client_drop (fopc->client); |
742 | switch (fopc->type) | 742 | switch (fopc->type) |
@@ -784,7 +784,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
784 | struct MessageQueue *mq_entry; | 784 | struct MessageQueue *mq_entry; |
785 | uint32_t id; | 785 | uint32_t id; |
786 | 786 | ||
787 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; | 787 | shutdown_task_id = NULL; |
788 | LOG_DEBUG ("Shutting down testbed service\n"); | 788 | LOG_DEBUG ("Shutting down testbed service\n"); |
789 | /* cleanup any remaining forwarded operations */ | 789 | /* cleanup any remaining forwarded operations */ |
790 | GST_clear_fopcq (); | 790 | GST_clear_fopcq (); |