factor out stop into new task (in preparation)
authorChristian Grothoff <christian@grothoff.org>
Tue, 4 Oct 2011 09:12:12 +0000 (09:12 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 4 Oct 2011 09:12:12 +0000 (09:12 +0000)
src/dht/test_dht_multipeer.c

index 09554472af67351d732b1138cbea6ff330da6b5a..8416577f0cfeb616283290aae06f28e4052c4b30 100644 (file)
@@ -228,6 +228,13 @@ shutdown_callback (void *cls, const char *emsg)
   }
 }
 
+static void
+do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
+  pg = NULL;
+}
+
 
 /**
  * Function scheduled to be run on the successful completion of this
@@ -265,10 +272,8 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                                 test_get);
     GNUNET_free (test_get);
   }
-
-  ok = 0;
-  GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
-  pg = NULL;
+  ok = 0; 
+  GNUNET_SCHEDULER_add_now (&do_stop, NULL);
 }