static void do_call (Client *client, CallType call_type) { /* only schedule in idle if we're not in the right thread */ if (g_main_context_get_thread_default () != client->main_context) schedule_call_in_idle (client, call_type); else actually_do_call (client, client->connection, call_type); }
static void do_call (Client *client, CallType call_type) { GMainContext *current_context; /* only schedule in idle if we're not in the right thread */ current_context = g_main_context_ref_thread_default (); if (current_context != client->main_context) schedule_call_in_idle (client, call_type); else actually_do_call (client, client->connection, client->name_owner, call_type); g_main_context_unref (current_context); }