mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-26 17:16:53 +02:00
gmain: Minor documentation updates to idle-once and timeout-once funcs
As suggested on !2684. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
50c316ef36
commit
c1f94cd1a5
37
glib/gmain.c
37
glib/gmain.c
@ -5188,29 +5188,10 @@ once_function (gpointer data)
|
|||||||
* Sets a function to be called after @interval milliseconds have elapsed,
|
* Sets a function to be called after @interval milliseconds have elapsed,
|
||||||
* with the default priority, %G_PRIORITY_DEFAULT.
|
* with the default priority, %G_PRIORITY_DEFAULT.
|
||||||
*
|
*
|
||||||
* The given @function is called once.
|
* The given @function is called once and then the source will be automatically
|
||||||
|
* removed from the main context.
|
||||||
*
|
*
|
||||||
* Note that timeout functions may be delayed, due to the processing of other
|
* This function otherwise behaves like g_timeout_add().
|
||||||
* event sources. Thus they should not be relied on for precise timing.
|
|
||||||
*
|
|
||||||
* See [memory management of sources][mainloop-memory-management] for details
|
|
||||||
* on how to handle the return value and memory management of @data.
|
|
||||||
*
|
|
||||||
* If you want to have a timer in the "seconds" range and do not care
|
|
||||||
* about the exact time of the first call of the timer, use the
|
|
||||||
* g_timeout_add_seconds() function; this function allows for more
|
|
||||||
* optimizations and more efficient system power usage.
|
|
||||||
*
|
|
||||||
* This internally creates a main loop source using g_timeout_source_new()
|
|
||||||
* and attaches it to the global #GMainContext using g_source_attach(), so
|
|
||||||
* the callback will be invoked in whichever thread is running that main
|
|
||||||
* context. You can do these steps manually if you need greater control or to
|
|
||||||
* use a custom main context.
|
|
||||||
*
|
|
||||||
* It is safe to call this function from any thread.
|
|
||||||
*
|
|
||||||
* The interval given is in terms of monotonic time, not wall clock
|
|
||||||
* time. See g_get_monotonic_time().
|
|
||||||
*
|
*
|
||||||
* Returns: the ID (greater than 0) of the event source
|
* Returns: the ID (greater than 0) of the event source
|
||||||
*
|
*
|
||||||
@ -6136,16 +6117,10 @@ g_idle_add (GSourceFunc function,
|
|||||||
* events pending to the default main loop. The function is given the
|
* events pending to the default main loop. The function is given the
|
||||||
* default idle priority, %G_PRIORITY_DEFAULT_IDLE.
|
* default idle priority, %G_PRIORITY_DEFAULT_IDLE.
|
||||||
*
|
*
|
||||||
* The function will only be called once.
|
* The function will only be called once and then the source will be
|
||||||
|
* automatically removed from the main context.
|
||||||
*
|
*
|
||||||
* See [memory management of sources][mainloop-memory-management] for details
|
* This function otherwise behaves like g_idle_add().
|
||||||
* on how to handle the return value and memory management of @data.
|
|
||||||
*
|
|
||||||
* This internally creates a main loop source using g_idle_source_new()
|
|
||||||
* and attaches it to the global #GMainContext using g_source_attach(), so
|
|
||||||
* the callback will be invoked in whichever thread is running that main
|
|
||||||
* context. You can do these steps manually if you need greater control or to
|
|
||||||
* use a custom main context.
|
|
||||||
*
|
*
|
||||||
* Returns: the ID (greater than 0) of the event source
|
* Returns: the ID (greater than 0) of the event source
|
||||||
*
|
*
|
||||||
|
@ -199,7 +199,8 @@ typedef gboolean (*GSourceFunc) (gpointer user_data);
|
|||||||
* @user_data: data passed to the function, set when the source was
|
* @user_data: data passed to the function, set when the source was
|
||||||
* created
|
* created
|
||||||
*
|
*
|
||||||
* A source function that is only called once.
|
* A source function that is only called once before being removed from the main
|
||||||
|
* context automatically.
|
||||||
*
|
*
|
||||||
* See: g_idle_add_once(), g_timeout_add_once()
|
* See: g_idle_add_once(), g_timeout_add_once()
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user