]> Pileus Git - ~andy/gtk/commitdiff
clarify section about gdk_threads_enter/ gdk_threads_leave to be reworded
authorTim Janik <timj@imendio.com>
Thu, 12 Jul 2007 16:13:11 +0000 (16:13 +0000)
committerTim Janik <timj@src.gnome.org>
Thu, 12 Jul 2007 16:13:11 +0000 (16:13 +0000)
Thu Jul 12 18:12:04 2007  Tim Janik  <timj@imendio.com>

        * gdk/tmpl/threads.sgml: clarify section about gdk_threads_enter/
        gdk_threads_leave to be reworded in terms of events and to mention
        availability of gdk_threads_add_idle_full().

svn path=/trunk/; revision=18457

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

index 9cf1e93a6f1d992bade3892ef90285f0e568d6df..c5f2f2c83cff2eae9c7a97abc4508748fcc9f032 100644 (file)
@@ -1,3 +1,9 @@
+Thu Jul 12 18:12:04 2007  Tim Janik  <timj@imendio.com>
+
+       * gdk/tmpl/threads.sgml: clarify section about gdk_threads_enter/
+       gdk_threads_leave to be reworded in terms of events and to mention
+       availability of gdk_threads_add_idle_full().
+
 2007-07-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/tmpl/gtkrange.sgml:
index 9f453cb60542a28381ef5bee86a2da1eaea974a4..110c69bee6091e2df69158dfb6f74df9a931e715 100644 (file)
@@ -31,12 +31,14 @@ You must call g_thread_init() and gdk_threads_init() before executing
 any other GTK+ or GDK functions in a threaded GTK+ program.
 </para>
 <para>
-Idles, timeouts, and input functions are executed outside
-of the main GTK+ lock. So, if you need to call GTK+
-inside of such a callback, you must surround the callback
-with a gdk_threads_enter()/gdk_threads_leave() pair.
-(However, signals are still executed within the main
-GTK+ lock.)
+Idles, timeouts, and input functions from GLib, such as g_idle_add(), are
+executed outside of the main GTK+ lock.
+So, if you need to call GTK+ inside of such a callback, you must surround
+the callback with a gdk_threads_enter()/gdk_threads_leave() pair or use
+gdk_threads_add_idle_full() which does this for you.
+However, event dispatching from the mainloop is still executed within
+the main GTK+ lock, so callback functions connected to event signals
+like GtkWidget::button-press-event, do not need thread protection.
 </para>
 <para>
 In particular, this means, if you are writing widgets that might