GMainContext *context;
gboolean consumed[10] = { };
GPollFD poll_fds[10];
+ gboolean acquired;
gboolean immediate;
gint max_priority;
gint timeout;
context = g_main_context_default ();
+ acquired = g_main_context_acquire (context);
+ g_assert (acquired);
+
immediate = g_main_context_prepare (context, &max_priority);
g_assert (!immediate);
n = g_main_context_query (context, max_priority, &timeout, poll_fds, 10);
if (g_main_context_check (context, max_priority, poll_fds, n))
g_main_context_dispatch (context);
+
+ g_main_context_release (context);
}
static gboolean