Add a paragraph about thread safety of GLib data structures.
authorMatthias Clasen <mclasen@redhat.com>
Fri, 20 May 2005 17:15:37 +0000 (17:15 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 20 May 2005 17:15:37 +0000 (17:15 +0000)
2005-05-20  Matthias Clasen  <mclasen@redhat.com>

* glib/tmpl/threads.sgml: Add a paragraph about thread
safety of GLib data structures.

docs/reference/ChangeLog
docs/reference/glib/tmpl/threads.sgml

index 3e2105004eef369bdd885c289cdad0cd085c5d3a..0c9df5f7387aae651d20ef6b04de1316a864fb8c 100644 (file)
@@ -1,5 +1,8 @@
 2005-05-20  Matthias Clasen  <mclasen@redhat.com>
 
+       * glib/tmpl/threads.sgml: Add a paragraph about thread
+       safety of GLib data structures.
+
        * glib/compiling.sgml: Update an example from 1.3 to 2.x
 
 2005-05-13  Matthias Clasen  <mclasen@redhat.com>
index e84bb98c55f852860b56f0a5d5c15a2279a410e3..80f50cc95934374a27ddf4e23d545c309af5fe66 100644 (file)
@@ -32,6 +32,14 @@ for thread-private data, that every thread has a private instance of
 primitives to portably create and manage threads (#GThread).
 </para>
 
+<para>
+You must call g_thread_init() before executing any other GLib functions 
+in a threaded GLib program. After that, GLib is completely thread safe 
+(all global data is automatically locked). But individual data structure 
+instances are not automatically locked for performance reasons. So e.g. 
+you must coordinate accesses to the same #GHashTable from multiple threads.
+</para>
+
 <!-- ##### SECTION See_Also ##### -->
 <para>
 <variablelist>