From a7143a0e9f597916e3cfb7e3b59674f571e9cba6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 13 Oct 2011 17:39:03 +0100 Subject: [PATCH] GDBusConnection: warn that direct access to the stream is a bad idea Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661679 Signed-off-by: Simon McVittie --- gio/gdbusconnection.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c index 83fed64..8a1ea15 100644 --- a/gio/gdbusconnection.c +++ b/gio/gdbusconnection.c @@ -674,6 +674,10 @@ g_dbus_connection_class_init (GDBusConnectionClass *klass) * If this is passed on construction and is a #GSocketConnection, * then the corresponding #GSocket will be put into non-blocking mode. * + * While the #GDBusConnection is active, it will interact with this + * stream from a worker thread, so it is not safe to interact with + * the stream directly. + * * Since: 2.26 */ g_object_class_install_property (gobject_class, @@ -947,6 +951,10 @@ g_dbus_connection_init (GDBusConnection *connection) * * Gets the underlying stream used for IO. * + * While the #GDBusConnection is active, it will interact with this + * stream from a worker thread, so it is not safe to interact with + * the stream directly. + * * Returns: (transfer none): the stream used for IO * * Since: 2.26 @@ -2501,6 +2509,10 @@ async_initable_iface_init (GAsyncInitableIface *async_initable_iface) * If @stream is a #GSocketConnection, then the corresponding #GSocket * will be put into non-blocking mode. * + * The D-Bus connection will interact with @stream from a worker thread. + * As a result, the caller should not interact with @stream after this + * method has been called, except by calling g_object_unref() on it. + * * If @observer is not %NULL it may be used to control the * authentication process. * @@ -2584,6 +2596,10 @@ g_dbus_connection_new_finish (GAsyncResult *res, * If @stream is a #GSocketConnection, then the corresponding #GSocket * will be put into non-blocking mode. * + * The D-Bus connection will interact with @stream from a worker thread. + * As a result, the caller should not interact with @stream after this + * method has been called, except by calling g_object_unref() on it. + * * If @observer is not %NULL it may be used to control the * authentication process. * -- 2.7.4