From: lurchi Date: Wed, 23 Aug 2017 13:45:52 +0000 (+0200) Subject: GNUNET_SCHEDULER_check_lifeness not needed anymore X-Git-Tag: gnunet-0.11.0rc0~48^2^2~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b5080c190338cc9031a9d81916828b0ddd855eb3;p=oweals%2Fgnunet.git GNUNET_SCHEDULER_check_lifeness not needed anymore --- 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 @@ -382,21 +382,6 @@ typedef int struct GNUNET_TIME_Relative timeout); -/** - * Check if the system has initiated shutdown. This means no tasks - * that prevent shutdown were present and all tasks added with - * #GNUNET_SCHEDULER_add_shutdown were run already. - * - * Can be used by external event loop implementations to decide - * whether to keep running or not. - * - * @return #GNUNET_YES if tasks which prevent shutdown exist - * #GNUNET_NO if the system has initiated shutdown - */ -int -GNUNET_SCHEDULER_check_lifeness (); - - /** * Initialize and run scheduler. This function will return when all * tasks have completed. On systems with signals, receiving a SIGTERM 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 () } -/** - * Check if the system has initiated shutdown. This means no tasks - * that prevent shutdown were present and all tasks added with - * #GNUNET_SCHEDULER_add_shutdown were run already. - * - * Can be used by external event loop implementations to decide - * whether to keep running or not. - * - * @return #GNUNET_YES if tasks which prevent shutdown exist - * #GNUNET_NO if the system has initiated shutdown - */ -// FIXME: make it an internal function again -int -GNUNET_SCHEDULER_check_lifeness () -{ - struct GNUNET_SCHEDULER_Task *t; - - if (ready_count > 0) - return GNUNET_YES; - for (t = pending_head; NULL != t; t = t->next) - if (t->lifeness == GNUNET_YES) - return GNUNET_YES; - for (t = shutdown_head; NULL != t; t = t->next) - if (t->lifeness == GNUNET_YES) - return GNUNET_YES; - for (t = pending_timeout_head; NULL != t; t = t->next) - if (t->lifeness == GNUNET_YES) - return GNUNET_YES; - if (NULL != shutdown_head) - { - GNUNET_SCHEDULER_shutdown (); - LOG (GNUNET_ERROR_TYPE_WARNING, - "shutting down\n"); - scheduler_driver->set_wakeup (scheduler_driver->cls, - GNUNET_TIME_absolute_get ()); - return GNUNET_YES; - } - return GNUNET_NO; -} - - void shutdown_if_no_lifeness () {