diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-30 08:17:37 +0000 |
commit | 95f9076a2139f5fb042b944a0658b6cda2fa35db (patch) | |
tree | b0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/rps/test_rps.c | |
parent | 7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff) | |
download | gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.tar.gz gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.zip |
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/rps/test_rps.c')
-rw-r--r-- | src/rps/test_rps.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index aca58d55e..128a81f21 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c | |||
@@ -38,7 +38,7 @@ | |||
38 | /** | 38 | /** |
39 | * How many peers do we start? | 39 | * How many peers do we start? |
40 | */ | 40 | */ |
41 | uint32_t num_peers; | 41 | static uint32_t num_peers; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * How long do we run the test? | 44 | * How long do we run the test? |
@@ -256,19 +256,12 @@ static unsigned int num_peers_online; | |||
256 | */ | 256 | */ |
257 | static int ok; | 257 | static int ok; |
258 | 258 | ||
259 | |||
260 | /** | 259 | /** |
261 | * Identifier for the churn task that runs periodically | 260 | * Identifier for the churn task that runs periodically |
262 | */ | 261 | */ |
263 | static struct GNUNET_SCHEDULER_Task *churn_task; | 262 | static struct GNUNET_SCHEDULER_Task *churn_task; |
264 | 263 | ||
265 | /** | 264 | /** |
266 | * Identifier for the churn task that runs periodically | ||
267 | */ | ||
268 | static struct GNUNET_SCHEDULER_Task *shutdown_task; | ||
269 | |||
270 | |||
271 | /** | ||
272 | * Called to initialise the given RPSPeer | 265 | * Called to initialise the given RPSPeer |
273 | */ | 266 | */ |
274 | typedef void (*InitPeer) (struct RPSPeer *rps_peer); | 267 | typedef void (*InitPeer) (struct RPSPeer *rps_peer); |
@@ -362,7 +355,7 @@ static int in_shutdown; | |||
362 | * Append arguments to file | 355 | * Append arguments to file |
363 | */ | 356 | */ |
364 | static void | 357 | static void |
365 | tofile_ (const char *file_name, char *line) | 358 | tofile_ (const char *file_name, const char *line) |
366 | { | 359 | { |
367 | struct GNUNET_DISK_FileHandle *f; | 360 | struct GNUNET_DISK_FileHandle *f; |
368 | /* char output_buffer[512]; */ | 361 | /* char output_buffer[512]; */ |
@@ -754,8 +747,7 @@ default_reply_handle (void *cls, | |||
754 | 747 | ||
755 | if (0 == evaluate ()) | 748 | if (0 == evaluate ()) |
756 | { | 749 | { |
757 | GNUNET_SCHEDULER_cancel (shutdown_task); | 750 | GNUNET_SCHEDULER_shutdown (); |
758 | shutdown_task = GNUNET_SCHEDULER_add_now (&shutdown_op, NULL); | ||
759 | } | 751 | } |
760 | } | 752 | } |
761 | 753 | ||
@@ -1388,7 +1380,7 @@ run (void *cls, | |||
1388 | 1380 | ||
1389 | if (NULL != churn_task) | 1381 | if (NULL != churn_task) |
1390 | GNUNET_SCHEDULER_cancel (churn_task); | 1382 | GNUNET_SCHEDULER_cancel (churn_task); |
1391 | shutdown_task = GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_op, NULL); | 1383 | GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_op, NULL); |
1392 | } | 1384 | } |
1393 | 1385 | ||
1394 | 1386 | ||