Skip to content

Commit a7f2155

Browse files
committed
Doc: libcrmcommon: Add a clarifying note to pcmk__create_timer()
I got confused for a little while about remote_auth_timeout_cb(). I thought returning G_SOURCE_REMOVE would cause g_source_remove() to get called on client->remote->source. But that is not the case. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
1 parent 730ad37 commit a7f2155

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/common/utils.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2004-2025 the Pacemaker project contributors
2+
* Copyright 2004-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -372,6 +372,11 @@ pcmk__sleep_ms(unsigned int ms)
372372
* \param[in] data Data to be passed to fn (can be NULL)
373373
*
374374
* \return The ID of the event source
375+
*
376+
* \note If \p fn returns \c G_SOURCE_CONTINUE, then it will be called again
377+
* after \p interval_ms. If \p fn returns \c G_SOURCE_REMOVE, then the
378+
* timeout is destroyed and \c fn will not be called again. Note that no
379+
* \c GDestroyNotify function is set, so only the timeout is destroyed.
375380
*/
376381
guint
377382
pcmk__create_timer(guint interval_ms, GSourceFunc fn, gpointer data)

0 commit comments

Comments
 (0)