mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 15:33:39 +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:
@@ -507,7 +507,7 @@ g_unix_input_stream_read_async (GInputStream *stream,
|
||||
cancellable);
|
||||
|
||||
g_source_set_callback (source, (GSourceFunc)read_async_cb, data, g_free);
|
||||
g_source_attach (source, NULL);
|
||||
g_source_attach (source, g_main_context_get_thread_default ());
|
||||
|
||||
g_source_unref (source);
|
||||
}
|
||||
@@ -635,7 +635,7 @@ g_unix_input_stream_close_async (GInputStream *stream,
|
||||
|
||||
idle = g_idle_source_new ();
|
||||
g_source_set_callback (idle, (GSourceFunc)close_async_cb, data, close_async_data_free);
|
||||
g_source_attach (idle, NULL);
|
||||
g_source_attach (idle, g_main_context_get_thread_default ());
|
||||
g_source_unref (idle);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user