Function
Gmtimeout_add_seconds_once_full
since: 0.0.1
Declaration [src]
guint
gm_timeout_add_seconds_once_full (
int priority,
gulong seconds,
GSourceOnceFunc function,
gpointer data,
GDestroyNotify notify
)
Description [src]
Sets a function to be called after a timeout with priority priority.
Correctly calculates the timeout even when the system is suspended in between.
This internally creates a main loop source using
g_timeout_source_new_seconds() and attaches it to the main loop context
using g_source_attach().
The timeout given is in terms of CLOCK_BOOTTIME time, it hence is also
correct across suspend and resume. If that doesn’t matter use
g_timeout_add_seconds_full instead.
Note that glib’s g_timeout_add_seconds() doesn’t take system
suspend/resume into account: https://gitlab.gnome.org/GNOME/glib/-/issues/2739
Changed in 0.3.0: Returns 0 when timer setup failed.
Available since: 0.0.1
This function is renamed to gm_timeout_add_seconds_once() in language bindings.
Parameters
priority-
Type:
intThe priority of the timeout source. Typically this will be in the range between
G_PRIORITY_DEFAULTandG_PRIORITY_HIGH. seconds-
Type:
gulongThe timeout in seconds.
function-
Type:
GSourceOnceFuncFunction to call.
data-
Type:
gpointerData to pass to
function.The argument can be NULL.The data is owned by the caller of the function. notify-
Type:
GDestroyNotifyFunction to call when the timeout is removed, or
NULL.The argument can be NULL.