diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-03-31 21:39:27 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-03-31 21:39:38 +0200 |
commit | a3e88087d09186d847ee8bf042ad665ab6cb0850 (patch) | |
tree | 4d6392a5229b539f2f320ed17e79a329c456741b /src/util/scheduler.c | |
parent | b6cf770ab68030d2ba6d7c2c9ed0a5655de4f1d6 (diff) | |
download | gnunet-a3e88087d09186d847ee8bf042ad665ab6cb0850.tar.gz gnunet-a3e88087d09186d847ee8bf042ad665ab6cb0850.zip |
make some functions static, ensure shutdown tasks could be run repeatedly if 1st shutdown did not finish the process
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r-- | src/util/scheduler.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 423c2b804..cc0ba3eb0 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -934,6 +934,11 @@ shutdown_pipe_cb (void *cls) | |||
934 | GNUNET_DISK_file_read (pr, &c, sizeof (c)); | 934 | GNUNET_DISK_file_read (pr, &c, sizeof (c)); |
935 | /* mark all active tasks as ready due to shutdown */ | 935 | /* mark all active tasks as ready due to shutdown */ |
936 | GNUNET_SCHEDULER_shutdown (); | 936 | GNUNET_SCHEDULER_shutdown (); |
937 | shutdown_pipe_task = | ||
938 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, | ||
939 | pr, | ||
940 | &shutdown_pipe_cb, | ||
941 | NULL); | ||
937 | } | 942 | } |
938 | 943 | ||
939 | 944 | ||
@@ -2202,8 +2207,8 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver) | |||
2202 | current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT; | 2207 | current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT; |
2203 | current_lifeness = GNUNET_NO; | 2208 | current_lifeness = GNUNET_NO; |
2204 | memset (&tsk, | 2209 | memset (&tsk, |
2205 | 0, | 2210 | 0, |
2206 | sizeof (tsk)); | 2211 | sizeof (tsk)); |
2207 | active_task = &tsk; | 2212 | active_task = &tsk; |
2208 | install_parent_control_task = | 2213 | install_parent_control_task = |
2209 | GNUNET_SCHEDULER_add_now (&install_parent_control_handler, | 2214 | GNUNET_SCHEDULER_add_now (&install_parent_control_handler, |
@@ -2239,7 +2244,8 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver) | |||
2239 | * | 2244 | * |
2240 | * @param sh the handle returned by #GNUNET_SCHEDULER_driver_init | 2245 | * @param sh the handle returned by #GNUNET_SCHEDULER_driver_init |
2241 | */ | 2246 | */ |
2242 | void GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh) | 2247 | void |
2248 | GNUNET_SCHEDULER_driver_done (struct GNUNET_SCHEDULER_Handle *sh) | ||
2243 | { | 2249 | { |
2244 | GNUNET_assert (NULL == pending_head); | 2250 | GNUNET_assert (NULL == pending_head); |
2245 | GNUNET_assert (NULL == pending_timeout_head); | 2251 | GNUNET_assert (NULL == pending_timeout_head); |
@@ -2440,7 +2446,7 @@ select_add (void *cls, | |||
2440 | } | 2446 | } |
2441 | 2447 | ||
2442 | 2448 | ||
2443 | int | 2449 | static int |
2444 | select_del (void *cls, | 2450 | select_del (void *cls, |
2445 | struct GNUNET_SCHEDULER_Task *task) | 2451 | struct GNUNET_SCHEDULER_Task *task) |
2446 | { | 2452 | { |
@@ -2470,7 +2476,7 @@ select_del (void *cls, | |||
2470 | } | 2476 | } |
2471 | 2477 | ||
2472 | 2478 | ||
2473 | void | 2479 | static void |
2474 | select_set_wakeup (void *cls, | 2480 | select_set_wakeup (void *cls, |
2475 | struct GNUNET_TIME_Absolute dt) | 2481 | struct GNUNET_TIME_Absolute dt) |
2476 | { | 2482 | { |