]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cyclic: document new guarantees for cyclic_(un)register
authorRasmus Villemoes <ravi@prevas.dk>
Wed, 7 May 2025 10:58:21 +0000 (12:58 +0200)
committerStefan Roese <sr@denx.de>
Fri, 16 May 2025 11:44:19 +0000 (13:44 +0200)
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Stefan Roese <sr@denx.de>
doc/develop/cyclic.rst

index 6f1da6f0d9bb525e5f6389f55257a01e2b0d9a95..a99b17052f506549429909460cf3c3f7a1309b30 100644 (file)
@@ -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.