aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tests
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
commit95f9076a2139f5fb042b944a0658b6cda2fa35db (patch)
treeb0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/ats-tests
parent7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff)
downloadgnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.tar.gz
gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.zip
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/ats-tests')
-rw-r--r--src/ats-tests/ats-testing-log.c8
-rw-r--r--src/ats-tests/perf_ats_logging.c15
2 files changed, 8 insertions, 15 deletions
diff --git a/src/ats-tests/ats-testing-log.c b/src/ats-tests/ats-testing-log.c
index 650be29f3..5e22d4b47 100644
--- a/src/ats-tests/ats-testing-log.c
+++ b/src/ats-tests/ats-testing-log.c
@@ -804,13 +804,9 @@ static void
804collect_log_task (void *cls) 804collect_log_task (void *cls)
805{ 805{
806 struct LoggingHandle *l = cls; 806 struct LoggingHandle *l = cls;
807 const struct GNUNET_SCHEDULER_TaskContext *tc;
808 807
809 l->log_task = NULL; 808 l->log_task = NULL;
810 GNUNET_ATS_TEST_logging_now (l); 809 GNUNET_ATS_TEST_logging_now (l);
811 tc = GNUNET_SCHEDULER_get_task_context ();
812 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
813 return;
814 l->log_task = GNUNET_SCHEDULER_add_delayed (l->frequency, 810 l->log_task = GNUNET_SCHEDULER_add_delayed (l->frequency,
815 &collect_log_task, 811 &collect_log_task,
816 l); 812 l);
@@ -829,8 +825,10 @@ GNUNET_ATS_TEST_logging_stop (struct LoggingHandle *l)
829 return; 825 return;
830 826
831 if (NULL != l->log_task) 827 if (NULL != l->log_task)
828 {
832 GNUNET_SCHEDULER_cancel (l->log_task); 829 GNUNET_SCHEDULER_cancel (l->log_task);
833 l->log_task = NULL; 830 l->log_task = NULL;
831 }
834 l->running = GNUNET_NO; 832 l->running = GNUNET_NO;
835 833
836 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 834 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
diff --git a/src/ats-tests/perf_ats_logging.c b/src/ats-tests/perf_ats_logging.c
index 1e4b15432..d4c4f2cd9 100644
--- a/src/ats-tests/perf_ats_logging.c
+++ b/src/ats-tests/perf_ats_logging.c
@@ -639,15 +639,8 @@ collect_log_now (void)
639static void 639static void
640collect_log_task (void *cls) 640collect_log_task (void *cls)
641{ 641{
642 const struct GNUNET_SCHEDULER_TaskContext *tc;
643
644 log_task = NULL; 642 log_task = NULL;
645 643 collect_log_now ();
646 collect_log_now();
647 tc = GNUNET_SCHEDULER_get_task_context ();
648 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
649 return;
650
651 log_task = GNUNET_SCHEDULER_add_delayed (frequency, 644 log_task = GNUNET_SCHEDULER_add_delayed (frequency,
652 &collect_log_task, NULL); 645 &collect_log_task, NULL);
653} 646}
@@ -659,12 +652,14 @@ perf_logging_stop ()
659 int c_m; 652 int c_m;
660 struct PeerLoggingTimestep *cur; 653 struct PeerLoggingTimestep *cur;
661 654
662 if (GNUNET_YES!= running) 655 if (GNUNET_YES != running)
663 return; 656 return;
664 657
665 if (NULL != log_task) 658 if (NULL != log_task)
659 {
666 GNUNET_SCHEDULER_cancel (log_task); 660 GNUNET_SCHEDULER_cancel (log_task);
667 log_task = NULL; 661 log_task = NULL;
662 }
668 collect_log_task (NULL); 663 collect_log_task (NULL);
669 664
670 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 665 GNUNET_log(GNUNET_ERROR_TYPE_INFO,