GNUNET_SCHEDULER_check_lifeness not needed anymore
authorlurchi <lurchi@strangeplace.net>
Wed, 23 Aug 2017 13:45:52 +0000 (15:45 +0200)
committerlurchi <lurchi@strangeplace.net>
Wed, 23 Aug 2017 13:45:52 +0000 (15:45 +0200)
src/include/gnunet_scheduler_lib.h
src/util/scheduler.c

index 5f938972664ec842060d96b675aff7e104e78692..119f3c8ed4923287a5c52e188ecb666098ad0912 100644 (file)
@@ -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
index 084ca43df7132fc1fc7242637ec3bac7af525800..b59919818704ebf1224e686b6c02f0777b731010 100644 (file)
@@ -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 ()
 {