diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
commit | 95f9076a2139f5fb042b944a0658b6cda2fa35db (patch) | |
tree | b0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/ats-tool | |
parent | 7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff) | |
download | gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.tar.gz gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.zip |
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/ats-tool')
-rw-r--r-- | src/ats-tool/gnunet-ats.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index a2ef80cef..5fc1d6e92 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c | |||
@@ -363,7 +363,7 @@ transport_addr_to_str_cb (void *cls, | |||
363 | /* All messages received and no resolutions pending*/ | 363 | /* All messages received and no resolutions pending*/ |
364 | if (shutdown_task != NULL) | 364 | if (shutdown_task != NULL) |
365 | GNUNET_SCHEDULER_cancel (shutdown_task); | 365 | GNUNET_SCHEDULER_cancel (shutdown_task); |
366 | shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL); | 366 | shutdown_task = GNUNET_SCHEDULER_add_now (&end, NULL); |
367 | } | 367 | } |
368 | return; | 368 | return; |
369 | } | 369 | } |
@@ -604,7 +604,7 @@ ats_perf_cb (void *cls, | |||
604 | /* All messages received and no resolutions pending*/ | 604 | /* All messages received and no resolutions pending*/ |
605 | if (shutdown_task != NULL) | 605 | if (shutdown_task != NULL) |
606 | GNUNET_SCHEDULER_cancel (shutdown_task); | 606 | GNUNET_SCHEDULER_cancel (shutdown_task); |
607 | shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL); | 607 | shutdown_task = GNUNET_SCHEDULER_add_now (&end, NULL); |
608 | } | 608 | } |
609 | return; | 609 | return; |
610 | } | 610 | } |
@@ -807,9 +807,8 @@ run (void *cls, | |||
807 | shutdown_task = GNUNET_SCHEDULER_add_now (&end, NULL); | 807 | shutdown_task = GNUNET_SCHEDULER_add_now (&end, NULL); |
808 | return; | 808 | return; |
809 | } | 809 | } |
810 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 810 | shutdown_task = GNUNET_SCHEDULER_add_shutdown (&end, |
811 | &end, | 811 | NULL); |
812 | NULL); | ||
813 | return; | 812 | return; |
814 | } | 813 | } |
815 | if (opt_list_used) | 814 | if (opt_list_used) |
@@ -834,9 +833,8 @@ run (void *cls, | |||
834 | shutdown_task = GNUNET_SCHEDULER_add_now (&end, NULL); | 833 | shutdown_task = GNUNET_SCHEDULER_add_now (&end, NULL); |
835 | return; | 834 | return; |
836 | } | 835 | } |
837 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 836 | shutdown_task = GNUNET_SCHEDULER_add_shutdown (&end, |
838 | &end, | 837 | NULL); |
839 | NULL); | ||
840 | return; | 838 | return; |
841 | } | 839 | } |
842 | if (opt_monitor) | 840 | if (opt_monitor) |
@@ -844,13 +842,15 @@ run (void *cls, | |||
844 | ph = GNUNET_ATS_performance_init (cfg, | 842 | ph = GNUNET_ATS_performance_init (cfg, |
845 | &ats_perf_mon_cb, | 843 | &ats_perf_mon_cb, |
846 | NULL); | 844 | NULL); |
845 | shutdown_task = GNUNET_SCHEDULER_add_shutdown (&end, | ||
846 | NULL); | ||
847 | if (NULL == ph) | 847 | if (NULL == ph) |
848 | { | ||
848 | FPRINTF (stderr, | 849 | FPRINTF (stderr, |
849 | "%s", | 850 | "%s", |
850 | _("Cannot connect to ATS service, exiting...\n")); | 851 | _("Cannot connect to ATS service, exiting...\n")); |
851 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 852 | GNUNET_SCHEDULER_shutdown (); |
852 | &end, | 853 | } |
853 | NULL); | ||
854 | return; | 854 | return; |
855 | } | 855 | } |
856 | if (opt_set_pref) | 856 | if (opt_set_pref) |