[glib] gtestdbus: Add a note about thread safety to the documentation



commit c07eccd9c212e1e1642ee8cd359f5066ee8e5295
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Tue Dec 3 08:27:05 2013 +0000

    gtestdbus: Add a note about thread safety to the documentation
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712148

 gio/gtestdbus.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c
index ea19683..a7410ac 100644
--- a/gio/gtestdbus.c
+++ b/gio/gtestdbus.c
@@ -323,6 +323,12 @@ _g_test_watcher_remove_pid (GPid pid)
  * A helper class for testing code which uses D-Bus without touching the user's
  * session bus.
  *
+ * Note that #GTestDBus modifies the user’s environment, calling setenv(). This
+ * is not thread-safe, so all #GTestDBus calls should be completed before
+ * threads are spawned, or should have appropriate locking to ensure no access
+ * conflicts to environment variables shared between #GTestDBus and other
+ * threads.
+ *
  * <refsect2 id="gio-D-Bus-Test-Scaffolding">
  *   <title>Creating unit tests using GTestDBus</title>
  *   <para>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]