From: Christian Grothoff Date: Thu, 21 Oct 2010 09:40:33 +0000 (+0000) Subject: extended load api X-Git-Tag: initial-import-from-subversion-38251~20002 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f6a270ac2ec89ed94ef00b97dd2f18b16fd6c306;p=oweals%2Fgnunet.git extended load api --- diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h index 7d3ec353e..ea2ad588e 100644 --- a/src/include/gnunet_load_lib.h +++ b/src/include/gnunet_load_lib.h @@ -55,6 +55,17 @@ struct GNUNET_LOAD_Value * GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); +/** + * Change the value by which the load automatically declines. + * + * @param load load to update + * @param autodecline frequency of load decline + */ +void +GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, + struct GNUNET_TIME_Relative autodecline); + + /** * Free a load value. * diff --git a/src/util/load.c b/src/util/load.c index be33ac1af..b7ab01540 100644 --- a/src/util/load.c +++ b/src/util/load.c @@ -127,6 +127,21 @@ GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline) } +/** + * Change the value by which the load automatically declines. + * + * @param load load to update + * @param autodecline frequency of load decline + */ +void +GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, + struct GNUNET_TIME_Relative autodecline) +{ + internal_update (load); + load->autodecline = autodecline; +} + + /** * Recalculate our load value. *