mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-04 16:33:40 +02:00
Support g_main_context_push_thread_default() in gio
GFile allows for the possibility that external implementations may not support thread-default contexts yet, via g_file_supports_thread_contexts(). GVolumeMonitor is not yet thread-default-context aware. Add a test program to verify that basic gio async ops work correctly in non-default contexts. http://bugzilla.gnome.org/show_bug.cgi?id=579984
This commit is contained in:
@@ -361,11 +361,11 @@ eject_unmount_do_cb (gpointer user_data)
|
||||
data->error_channel_source = g_io_create_watch (data->error_channel, G_IO_IN);
|
||||
g_source_set_callback (data->error_channel_source,
|
||||
(GSourceFunc) eject_unmount_read_error, data, NULL);
|
||||
g_source_attach (data->error_channel_source, NULL);
|
||||
g_source_attach (data->error_channel_source, g_main_context_get_thread_default ());
|
||||
|
||||
child_watch = g_child_watch_source_new (child_pid);
|
||||
g_source_set_callback (child_watch, (GSourceFunc) eject_unmount_cb, data, NULL);
|
||||
g_source_attach (child_watch, NULL);
|
||||
g_source_attach (child_watch, g_main_context_get_thread_default ());
|
||||
g_source_unref (child_watch);
|
||||
|
||||
handle_error:
|
||||
|
Reference in New Issue
Block a user