From 920147ee8f81c30fead11e746e08050ae195c31e Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Thu, 12 Jul 2007 16:13:11 +0000 Subject: [PATCH] clarify section about gdk_threads_enter/ gdk_threads_leave to be reworded Thu Jul 12 18:12:04 2007 Tim Janik * 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 | 6 ++++++ docs/reference/gdk/tmpl/threads.sgml | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 9cf1e93a6f..c5f2f2c83c 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +Thu Jul 12 18:12:04 2007 Tim Janik + + * 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 * gtk/tmpl/gtkrange.sgml: diff --git a/docs/reference/gdk/tmpl/threads.sgml b/docs/reference/gdk/tmpl/threads.sgml index 9f453cb605..110c69bee6 100644 --- a/docs/reference/gdk/tmpl/threads.sgml +++ b/docs/reference/gdk/tmpl/threads.sgml @@ -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. -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. In particular, this means, if you are writing widgets that might