summaryrefslogtreecommitdiff
path: root/doc/develop
diff options
context:
space:
mode:
authorRasmus Villemoes <ravi@prevas.dk>2025-05-07 12:58:21 +0200
committerStefan Roese <sr@denx.de>2025-05-16 13:44:19 +0200
commit6f0a3cd7bcdd4ce25b5ad253a6ebad88d4b94fbe (patch)
treeba14f6960051096be450c88a97b32dd40696a05b /doc/develop
parent5265143ac7356b94ace3e26a9fd6df17774b189b (diff)
cyclic: document new guarantees for cyclic_(un)register
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'doc/develop')
-rw-r--r--doc/develop/cyclic.rst13
1 files changed, 13 insertions, 0 deletions
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.