GLib.MainContext.ref_thread_default

function ref_thread_default(): GLib.MainContext {
    // Gjs wrapper for g_main_context_ref_thread_default()
}
  

Gets the thread-default GLib.MainContext for this thread, as with GLib.main_context_get_thread_default, but also adds a reference to it with GLib.MainContext.prototype.ref. In addition, unlike GLib.main_context_get_thread_default, if the thread-default context is the global default context, this will return that GLib.MainContext (with a ref added to it) rather than returning null.

Since 2.32

Returns

the thread-default GLib.MainContext. Unref with GLib.MainContext.prototype.unref when you are done with it.