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 | |
parent | 357181530f9089ee30ba88c55ed429ec58505357 (diff) | |
download | gnunet-b5080c190338cc9031a9d81916828b0ddd855eb3.tar.gz gnunet-b5080c190338cc9031a9d81916828b0ddd855eb3.zip |
GNUNET_SCHEDULER_check_lifeness not needed anymore
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_scheduler_lib.h | 15 | ||||
-rw-r--r-- | src/util/scheduler.c | 41 |
2 files changed, 0 insertions, 56 deletions
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 5f9389726..119f3c8ed 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h | |||
@@ -383,21 +383,6 @@ typedef int | |||
383 | 383 | ||
384 | 384 | ||
385 | /** | 385 | /** |
386 | * Check if the system has initiated shutdown. This means no tasks | ||
387 | * that prevent shutdown were present and all tasks added with | ||
388 | * #GNUNET_SCHEDULER_add_shutdown were run already. | ||
389 | * | ||
390 | * Can be used by external event loop implementations to decide | ||
391 | * whether to keep running or not. | ||
392 | * | ||
393 | * @return #GNUNET_YES if tasks which prevent shutdown exist | ||
394 | * #GNUNET_NO if the system has initiated shutdown | ||
395 | */ | ||
396 | int | ||
397 | GNUNET_SCHEDULER_check_lifeness (); | ||
398 | |||
399 | |||
400 | /** | ||
401 | * Initialize and run scheduler. This function will return when all | 386 | * Initialize and run scheduler. This function will return when all |
402 | * tasks have completed. On systems with signals, receiving a SIGTERM | 387 | * tasks have completed. On systems with signals, receiving a SIGTERM |
403 | * (and other similar signals) will cause #GNUNET_SCHEDULER_shutdown | 388 | * (and other similar signals) will cause #GNUNET_SCHEDULER_shutdown |
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 | { |