GDBusConnection: warn that direct access to the stream is a bad idea
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 13 Oct 2011 16:39:03 +0000 (17:39 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 15 Oct 2011 22:03:19 +0000 (18:03 -0400)
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661679
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
gio/gdbusconnection.c

index 83fed64..8a1ea15 100644 (file)
@@ -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.
  *