add_child_source


Description:

[ Version ( since = "2.28" ) ]
public void add_child_source (Source child_source)

Adds child_source to this as a ‘polled’ source.

When this is added to a [struct@GLib.MainContext], child_source will be automatically added with the same priority. When child_source is triggered, it will cause this to dispatch (in addition to calling its own callback), and when this is destroyed, it will destroy child_source as well.

The this will also still be dispatched if its own prepare/check functions indicate that it is ready.

If you don’t need child_source to do anything on its own when it triggers, you can call `g_source_set_dummy_callback()` on it to set a callback that does nothing (except return true if appropriate).

The this will hold a reference on child_source while child_source is attached to it.

This API is only intended to be used by implementations of [struct@GLib.Source]. Do not call this API on a [struct@GLib.Source] that you did not create.

Parameters:

this

a source

child_source

a second source that this should ‘poll’