[PATCH 3/3] cyclic: document new guarantees for cyclic_(un)register
Stefan Roese
sr at denx.de
Thu May 8 09:27:17 CEST 2025
On 07.05.25 12:58, Rasmus Villemoes wrote:
> Signed-off-by: Rasmus Villemoes <ravi at prevas.dk>
Reviewed-by: Stefan Roese <sr at denx.de>
Thanks,
Stefan
> ---
> doc/develop/cyclic.rst | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/doc/develop/cyclic.rst b/doc/develop/cyclic.rst
> index 6f1da6f0d9b..a99b17052f5 100644
> --- a/doc/develop/cyclic.rst
> +++ b/doc/develop/cyclic.rst
> @@ -54,3 +54,16 @@ responsible for calling all registered cyclic functions, into the
> common schedule() function. This guarantees that cyclic_run() is
> executed very often, which is necessary for the cyclic functions to
> get scheduled and executed at their configured periods.
> +
> +Idempotence
> +-----------
> +
> +Both the cyclic_register() and cyclic_unregister() functions are safe
> +to call on any struct cyclic_info, regardless of whether that instance
> +is already registered or not.
> +
> +More specifically, calling cyclic_unregister() with a cyclic_info
> +which is not currently registered is a no-op, while calling
> +cyclic_register() with a cyclic_info which is currently registered
> +results in it being automatically unregistered, and then registered
> +with the new callback function and timeout parameters.
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
More information about the U-Boot
mailing list