From 8ed0131e0f2eb29e1bb947d66d482149b10a25a2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 15 Nov 2009 18:12:39 +0000 Subject: [PATCH] do not use sleep, use scheduler --- src/topology/test_gnunet_service_topology.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/topology/test_gnunet_service_topology.c b/src/topology/test_gnunet_service_topology.c index 3cd39f49d..dfd53cf8a 100644 --- a/src/topology/test_gnunet_service_topology.c +++ b/src/topology/test_gnunet_service_topology.c @@ -49,6 +49,15 @@ static struct GNUNET_TESTING_Daemon *last; static struct GNUNET_SCHEDULER_Handle *sched; +static void +clean_up_task (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc) +{ + GNUNET_TESTING_daemons_stop (pg); + ok = 0; +} + + static void notify_connect_complete(void *cls, const char *emsg) @@ -67,9 +76,10 @@ notify_connect_complete(void *cls, /* FIXME: check that topology adds a few more links in addition to those that were seeded */ /* For now, sleep so we can have the daemon do some work */ - sleep (10); - GNUNET_TESTING_daemons_stop (pg); - ok = 0; + GNUNET_SCHEDULER_add_delayed (sched, + GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5), + &clean_up_task, + NULL); } } -- 2.25.1