From: Christian Grothoff Date: Sun, 15 Nov 2009 18:12:39 +0000 (+0000) Subject: do not use sleep, use scheduler X-Git-Tag: initial-import-from-subversion-38251~23071 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8ed0131e0f2eb29e1bb947d66d482149b10a25a2;p=oweals%2Fgnunet.git do not use sleep, use scheduler --- 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); } }