aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2017-08-04 08:45:30 +0200
committert3sserakt <t3ss@posteo.de>2017-08-04 08:45:30 +0200
commit646bbf4ddba3a37c4af0bb62e90be48a465d2004 (patch)
treead6d2f03eef5ca009f10a7e98c9ede1bfe68298c /src
parent06a875a49e9e020a504ff38e5e61691cb116fe14 (diff)
downloadgnunet-646bbf4ddba3a37c4af0bb62e90be48a465d2004.tar.gz
gnunet-646bbf4ddba3a37c4af0bb62e90be48a465d2004.zip
GNUNET_SCHEDULER_run is calling GNUNET_SCHEDULER_run_with_driver with the default select polling backend.
Diffstat (limited to 'src')
-rw-r--r--src/util/scheduler.c74
1 files changed, 1 insertions, 73 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 7fe18bbe6..e442989d0 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -928,81 +928,9 @@ void
928GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task, 928GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task,
929 void *task_cls) 929 void *task_cls)
930{ 930{
931 struct GNUNET_NETWORK_FDSet *rs;
932 struct GNUNET_NETWORK_FDSet *ws;
933
934
935 struct GNUNET_SIGNAL_Context *shc_int;
936 struct GNUNET_SIGNAL_Context *shc_term;
937#if (SIGTERM != GNUNET_TERM_SIG)
938 struct GNUNET_SIGNAL_Context *shc_gterm;
939#endif
940
941#ifndef MINGW
942 struct GNUNET_SIGNAL_Context *shc_quit;
943 struct GNUNET_SIGNAL_Context *shc_hup;
944 struct GNUNET_SIGNAL_Context *shc_pipe;
945#endif
946
947
948 931
949 GNUNET_assert (NULL == active_task); 932 GNUNET_SCHEDULER_run_with_driver(GNUNET_SCHEDULER_driver_select, task, task_cls);
950 rs = GNUNET_NETWORK_fdset_create ();
951 ws = GNUNET_NETWORK_fdset_create ();
952 GNUNET_assert (NULL == shutdown_pipe_handle);
953 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO,
954 GNUNET_NO,
955 GNUNET_NO,
956 GNUNET_NO);
957 GNUNET_assert (NULL != shutdown_pipe_handle);
958 933
959 my_pid = getpid ();
960 LOG (GNUNET_ERROR_TYPE_DEBUG,
961 "Registering signal handlers\n");
962 shc_int = GNUNET_SIGNAL_handler_install (SIGINT,
963 &sighandler_shutdown);
964 shc_term = GNUNET_SIGNAL_handler_install (SIGTERM,
965 &sighandler_shutdown);
966#if (SIGTERM != GNUNET_TERM_SIG)
967 shc_gterm = GNUNET_SIGNAL_handler_install (GNUNET_TERM_SIG,
968 &sighandler_shutdown);
969#endif
970#ifndef MINGW
971 shc_pipe = GNUNET_SIGNAL_handler_install (SIGPIPE,
972 &sighandler_pipe);
973 shc_quit = GNUNET_SIGNAL_handler_install (SIGQUIT,
974 &sighandler_shutdown);
975 shc_hup = GNUNET_SIGNAL_handler_install (SIGHUP,
976 &sighandler_shutdown);
977#endif
978 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT;
979 current_lifeness = GNUNET_YES;
980 GNUNET_SCHEDULER_add_with_reason_and_priority (task,
981 task_cls,
982 GNUNET_SCHEDULER_REASON_STARTUP,
983 GNUNET_SCHEDULER_PRIORITY_DEFAULT);
984 active_task = (void *) (long) -1; /* force passing of sanity check */
985 GNUNET_SCHEDULER_add_now_with_lifeness (GNUNET_NO,
986 &GNUNET_OS_install_parent_control_handler,
987 NULL);
988 active_task = NULL;
989
990
991 while_live(rs, ws);
992 GNUNET_SIGNAL_handler_uninstall (shc_int);
993 GNUNET_SIGNAL_handler_uninstall (shc_term);
994#if (SIGTERM != GNUNET_TERM_SIG)
995 GNUNET_SIGNAL_handler_uninstall (shc_gterm);
996#endif
997#ifndef MINGW
998 GNUNET_SIGNAL_handler_uninstall (shc_pipe);
999 GNUNET_SIGNAL_handler_uninstall (shc_quit);
1000 GNUNET_SIGNAL_handler_uninstall (shc_hup);
1001#endif
1002 GNUNET_DISK_pipe_close (shutdown_pipe_handle);
1003 shutdown_pipe_handle = NULL;
1004 GNUNET_NETWORK_fdset_destroy (rs);
1005 GNUNET_NETWORK_fdset_destroy (ws);
1006} 934}
1007 935
1008 936