diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-28 13:26:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-28 13:26:30 +0000 |
commit | 00b9920ee8fa14275bcb910a9660046cbf7ffae7 (patch) | |
tree | 52178dadc8650cf09b802a0cd4fa4219b86c2f0a /src/ats | |
parent | 90c8b6d3aee86a6ae12ad5ccf85e1de3769c86cc (diff) | |
download | gnunet-00b9920ee8fa14275bcb910a9660046cbf7ffae7.tar.gz gnunet-00b9920ee8fa14275bcb910a9660046cbf7ffae7.zip |
disable solver during aging, ensure there is only one aging task
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats_preferences.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ats/gnunet-service-ats_preferences.c b/src/ats/gnunet-service-ats_preferences.c index 8c0b13ab0..1a862d602 100644 --- a/src/ats/gnunet-service-ats_preferences.c +++ b/src/ats/gnunet-service-ats_preferences.c | |||
@@ -397,19 +397,22 @@ preference_aging (void *cls, | |||
397 | struct AgeContext ac; | 397 | struct AgeContext ac; |
398 | 398 | ||
399 | aging_task = NULL; | 399 | aging_task = NULL; |
400 | GAS_plugin_solver_lock (); | ||
400 | ac.values_to_update = 0; | 401 | ac.values_to_update = 0; |
401 | for (ac.cur_client = pc_head; NULL != ac.cur_client; ac.cur_client = ac.cur_client->next) | 402 | for (ac.cur_client = pc_head; NULL != ac.cur_client; ac.cur_client = ac.cur_client->next) |
402 | GNUNET_CONTAINER_multipeermap_iterate (ac.cur_client->peer2pref, | 403 | GNUNET_CONTAINER_multipeermap_iterate (ac.cur_client->peer2pref, |
403 | &age_values, | 404 | &age_values, |
404 | &ac); | 405 | &ac); |
406 | GAS_plugin_solver_unlock (); | ||
405 | if (ac.values_to_update > 0) | 407 | if (ac.values_to_update > 0) |
406 | { | 408 | { |
407 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 409 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
408 | "Rescheduling aging task due to %u elements remaining to age\n", | 410 | "Rescheduling aging task due to %u elements remaining to age\n", |
409 | ac.values_to_update); | 411 | ac.values_to_update); |
410 | aging_task = GNUNET_SCHEDULER_add_delayed (PREF_AGING_INTERVAL, | 412 | if (NULL == aging_task) |
411 | &preference_aging, | 413 | aging_task = GNUNET_SCHEDULER_add_delayed (PREF_AGING_INTERVAL, |
412 | NULL); | 414 | &preference_aging, |
415 | NULL); | ||
413 | } | 416 | } |
414 | else | 417 | else |
415 | { | 418 | { |