diff options
author | lurchi <lurchi@strangeplace.net> | 2017-08-23 15:45:52 +0200 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2017-08-23 15:45:52 +0200 |
commit | b5080c190338cc9031a9d81916828b0ddd855eb3 (patch) | |
tree | 2e91ff9ecb1a0a84b77e27f5d9c0f759f8bbf4de /src/util/scheduler.c | |
parent | 357181530f9089ee30ba88c55ed429ec58505357 (diff) | |
download | gnunet-b5080c190338cc9031a9d81916828b0ddd855eb3.tar.gz gnunet-b5080c190338cc9031a9d81916828b0ddd855eb3.zip |
GNUNET_SCHEDULER_check_lifeness not needed anymore
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r-- | src/util/scheduler.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 084ca43df..b59919818 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -604,47 +604,6 @@ sighandler_shutdown () | |||
604 | } | 604 | } |
605 | 605 | ||
606 | 606 | ||
607 | /** | ||
608 | * Check if the system has initiated shutdown. This means no tasks | ||
609 | * that prevent shutdown were present and all tasks added with | ||
610 | * #GNUNET_SCHEDULER_add_shutdown were run already. | ||
611 | * | ||
612 | * Can be used by external event loop implementations to decide | ||
613 | * whether to keep running or not. | ||
614 | * | ||
615 | * @return #GNUNET_YES if tasks which prevent shutdown exist | ||
616 | * #GNUNET_NO if the system has initiated shutdown | ||
617 | */ | ||
618 | // FIXME: make it an internal function again | ||
619 | int | ||
620 | GNUNET_SCHEDULER_check_lifeness () | ||
621 | { | ||
622 | struct GNUNET_SCHEDULER_Task *t; | ||
623 | |||
624 | if (ready_count > 0) | ||
625 | return GNUNET_YES; | ||
626 | for (t = pending_head; NULL != t; t = t->next) | ||
627 | if (t->lifeness == GNUNET_YES) | ||
628 | return GNUNET_YES; | ||
629 | for (t = shutdown_head; NULL != t; t = t->next) | ||
630 | if (t->lifeness == GNUNET_YES) | ||
631 | return GNUNET_YES; | ||
632 | for (t = pending_timeout_head; NULL != t; t = t->next) | ||
633 | if (t->lifeness == GNUNET_YES) | ||
634 | return GNUNET_YES; | ||
635 | if (NULL != shutdown_head) | ||
636 | { | ||
637 | GNUNET_SCHEDULER_shutdown (); | ||
638 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
639 | "shutting down\n"); | ||
640 | scheduler_driver->set_wakeup (scheduler_driver->cls, | ||
641 | GNUNET_TIME_absolute_get ()); | ||
642 | return GNUNET_YES; | ||
643 | } | ||
644 | return GNUNET_NO; | ||
645 | } | ||
646 | |||
647 | |||
648 | void | 607 | void |
649 | shutdown_if_no_lifeness () | 608 | shutdown_if_no_lifeness () |
650 | { | 609 | { |