Function

Gmtimeout_add_seconds_once

since: 0.0.1

[]

Declaration [src]

guint
gm_timeout_add_seconds_once (
  int seconds,
  GSourceOnceFunc function,
  gpointer data
)
[]

Description [src]

Sets a function to be called after a timeout with the default priority, G_PRIORITY_DEFAULT. 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 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.

Available since: 0.0.1

This function is not directly available to language bindings.

The implementation of this function is provided by gm_timeout_add_seconds_once_full() in language bindings.

[]

Parameters

seconds

Type: int

The timeout in seconds.

function

Type: GSourceOnceFunc

Function to call.

data

Type: gpointer

Data to pass to function.

The argument can be NULL.
The data is owned by the caller of the function.
[]

Return value

Type: guint

The ID (greater than 0) of the event source.