Struct
GLibMainContext
Description [src]
struct GMainContext {
/* No available fields */
}
The GMainContext
struct is an opaque data
type representing a set of sources to be handled in a main loop.
Functions
g_main_context_pusher_free
Pop pusher
’s main context as the thread default main context.
See g_main_context_pusher_new()
for details.
since: 2.64
g_main_context_ref_thread_default
Gets a reference to the thread-default GMainContext
for this thread.
since: 2.32
Instance methods
g_main_context_add_poll
Adds a file descriptor to the set of file descriptors polled for this context.
g_main_context_find_source_by_funcs_user_data
Finds a source with the given source functions and user data.
g_main_context_invoke
Invokes a function in such a way that context
is owned during the
invocation of function
.
since: 2.28
g_main_context_invoke_full
Invokes a function in such a way that context
is owned during the
invocation of function
.
since: 2.28
g_main_context_is_owner
Determines whether this thread holds the (recursive)
ownership of this GMainContext
.
since: 2.10
g_main_context_pop_thread_default
Pops context
off the thread-default context stack (verifying that
it was on the top of the stack).
since: 2.22
g_main_context_push_thread_default
Acquires context
and sets it as the thread-default context for the
current thread. This will cause certain asynchronous operations
(such as most Gio-based I/O) which are
started in this thread to run under context
and deliver their
results to its main loop, rather than running under the global
default main context in the main thread. Note that calling this function
changes the context returned by g_main_context_get_thread_default()
,
not the one returned by g_main_context_default()
, so it does not
affect the context used by functions like g_idle_add()
.
since: 2.22
g_main_context_pusher_new
Push main_context
as the new thread-default main context for the current
thread, using g_main_context_push_thread_default()
, and return a
new GMainContextPusher
. Pop with g_main_context_pusher_free().
Using g_main_context_pop_thread_default()
on main_context
while a
GMainContextPusher
exists for it can lead to undefined behaviour.
since: 2.64
g_main_context_release
Releases ownership of a context previously acquired by this thread
with g_main_context_acquire()
.
g_main_context_remove_poll
Removes file descriptor from the set of file descriptors to be polled for a particular context.
g_main_context_unref
Decreases the reference count on a GMainContext
object by one.
If
the result is zero, free the context and free all associated memory.
g_main_context_wait
Tries to become the owner of the specified context, and waits on cond
if
another thread is the owner.
deprecated: 2.58
g_main_context_wakeup
Wake up context
if it’s currently blocking in
g_main_context_iteration()
, causing it to stop blocking.