Function

GLib-2.0GLibmain_context_get_thread_defaultSince 2.22

  • Gets the thread-default main context for this thread.

    Asynchronous operations that want to be able to be run in contexts other than the default one should call this method or GLib.MainContext.ref_thread_default to get a GLib.MainContext to add their GLib.Sources to. (Note that even in single-threaded programs applications may sometimes want to temporarily push a non-default context, so it is not safe to assume that this will always return NULL if you are running in the default thread.)

    If you need to hold a reference on the context, use GLib.MainContext.ref_thread_default instead.

    Returns GLib.MainContext

    the thread-default main context, or NULL if the thread-default context is the global-default main context

    2.22