MainContext
The GMainContext
struct is an opaque data type representing a set of sources to be handled in a main loop.
Skipped during bindings generation
parameter
fds
: PollFDparameter
user_data
: gpointerparameter
user_data
: gpointerparameter
priority
: priority: Out parameter is not supportedparameter
timeout_
: timeout_: Out parameter is not supportedparameter
mutex
: Mutex
Constructors
Functions
Tries to become the owner of the specified context. If some other thread is the owner of the context, returns false immediately. Ownership is properly recursive: the owner can require ownership again and will release ownership when method@GLib.MainContext.release is called as many times as method@GLib.MainContext.acquire.
Finds a #GSource given a pair of context and ID.
Invokes a function in such a way that @context is owned during the invocation of @function.
Runs a single iteration for the given main loop. This involves checking to see if any event sources are ready to be processed, then if no events sources are ready and @may_block is true, waiting for a source to become ready, then dispatching the highest priority events sources that are ready. Otherwise, if @may_block is false sources are not waited to become ready, only those highest priority events sources will be dispatched (if any), that are ready at this given moment without further waiting.
Pops @context off the thread-default context stack (verifying that it was on the top of the stack).
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 func@GLib.MainContext.get_thread_default, not the one returned by func@GLib.MainContext.default, so it does not affect the context used by functions like func@GLib.idle_add.
Increases the reference count on a struct@GLib.MainContext object by one.
Releases ownership of a context previously acquired by this thread with method@GLib.MainContext.acquire. If the context was acquired multiple times, the ownership will be released only when method@GLib.MainContext.release is called as many times as it was acquired.
Removes file descriptor from the set of file descriptors to be polled for a particular context.