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/peerstore/peerstore_api.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/peerstore/peerstore_api.c')
-rw-r--r-- | src/peerstore/peerstore_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c index 39f37b022..2138b23ff 100644 --- a/src/peerstore/peerstore_api.c +++ b/src/peerstore/peerstore_api.c | |||
@@ -213,7 +213,7 @@ struct GNUNET_PEERSTORE_IterateContext | |||
213 | * Task identifier for the function called | 213 | * Task identifier for the function called |
214 | * on iterate request timeout | 214 | * on iterate request timeout |
215 | */ | 215 | */ |
216 | GNUNET_SCHEDULER_TaskIdentifier timeout_task; | 216 | struct GNUNET_SCHEDULER_Task * timeout_task; |
217 | 217 | ||
218 | }; | 218 | }; |
219 | 219 | ||
@@ -367,7 +367,7 @@ iterate_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
367 | GNUNET_PEERSTORE_Processor callback; | 367 | GNUNET_PEERSTORE_Processor callback; |
368 | void *callback_cls; | 368 | void *callback_cls; |
369 | 369 | ||
370 | ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 370 | ic->timeout_task = NULL; |
371 | callback = ic->callback; | 371 | callback = ic->callback; |
372 | callback_cls = ic->callback_cls; | 372 | callback_cls = ic->callback_cls; |
373 | GNUNET_PEERSTORE_iterate_cancel (ic); | 373 | GNUNET_PEERSTORE_iterate_cancel (ic); |
@@ -729,10 +729,10 @@ handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg) | |||
729 | void | 729 | void |
730 | GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic) | 730 | GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic) |
731 | { | 731 | { |
732 | if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task) | 732 | if (NULL != ic->timeout_task) |
733 | { | 733 | { |
734 | GNUNET_SCHEDULER_cancel (ic->timeout_task); | 734 | GNUNET_SCHEDULER_cancel (ic->timeout_task); |
735 | ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 735 | ic->timeout_task = NULL; |
736 | } | 736 | } |
737 | if (GNUNET_NO == ic->iterating) | 737 | if (GNUNET_NO == ic->iterating) |
738 | { | 738 | { |