diff --git a/test_crypto.c b/test_crypto.c index 0aa4222..a96be12 100644 --- a/test_crypto.c +++ b/test_crypto.c @@ -360,18 +360,27 @@ cleanup_auction_data () free (ad); } + +static struct GNUNET_SCHEDULER_Task *wt; + static void ending (void *arg) { printf ("Good bye!!\n"); + GNUNET_SCHEDULER_cancel (wt); } static void world (void *arg) { + static int c++; printf ("World!\n"); - GNUNET_SCHEDULER_shutdown (); + wt = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, + &world, + NULL); + if (11 == c) + GNUNET_SCHEDULER_shutdown (); } @@ -380,9 +389,9 @@ hello (void *arg) { printf ("Hello\n"); GNUNET_SCHEDULER_add_shutdown (&ending, NULL); - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, - &world, - NULL); + wt = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, + &world, + NULL); }