+Mon Oct 22 08:51:02 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
+ Add a function, gdk_threads_init() that must be explicitely
+ called to enable the GDK thread mutex.
+
2001-10-22 Jakub Steiner <jimmac@ximian.com>
* gtk/stock-icons/stock_stop.png: no body parts
+Mon Oct 22 08:51:02 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
+ Add a function, gdk_threads_init() that must be explicitely
+ called to enable the GDK thread mutex.
+
2001-10-22 Jakub Steiner <jimmac@ximian.com>
* gtk/stock-icons/stock_stop.png: no body parts
+Mon Oct 22 08:51:02 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
+ Add a function, gdk_threads_init() that must be explicitely
+ called to enable the GDK thread mutex.
+
2001-10-22 Jakub Steiner <jimmac@ximian.com>
* gtk/stock-icons/stock_stop.png: no body parts
+Mon Oct 22 08:51:02 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
+ Add a function, gdk_threads_init() that must be explicitely
+ called to enable the GDK thread mutex.
+
2001-10-22 Jakub Steiner <jimmac@ximian.com>
* gtk/stock-icons/stock_stop.png: no body parts
+Mon Oct 22 08:51:02 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
+ Add a function, gdk_threads_init() that must be explicitely
+ called to enable the GDK thread mutex.
+
2001-10-22 Jakub Steiner <jimmac@ximian.com>
* gtk/stock-icons/stock_stop.png: no body parts
+Mon Oct 22 08:51:02 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
+ Add a function, gdk_threads_init() that must be explicitely
+ called to enable the GDK thread mutex.
+
2001-10-22 Jakub Steiner <jimmac@ximian.com>
* gtk/stock-icons/stock_stop.png: no body parts
+Mon Oct 22 08:51:02 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
+ Add a function, gdk_threads_init() that must be explicitely
+ called to enable the GDK thread mutex.
+
2001-10-22 Jakub Steiner <jimmac@ximian.com>
* gtk/stock-icons/stock_stop.png: no body parts
* The default selected day for GtkCalendar is now the current day in the
month, not the first day in the month. The current month and year
were already used.
+
+* GDK is no longer put into threaded mode automatically when
+ g_thread_init() has been called. In order to use the
+ global GDK thread mutex with gdk_threads_enter() and
+ gdk_threads_leave(), you must call gdk_threads_init() explicitely.
+ gdk_threads_init() calls g_thread_init() if it hasn't already
+ been called, so you can typically change your call to g_thread_init()
+ into a call to gdk_threads_init().
+
+ If you aren't using GDK and GTK+ functions from multiple threads,
+ there is no reason to call gdk_threads_init().
if (gdk_initialized)
return TRUE;
- if (g_thread_supported ())
- gdk_threads_mutex = g_mutex_new ();
-
if (argc && argv)
{
argc_orig = *argc;
GDK_THREADS_LEAVE ();
}
+/**
+ * gdk_threads_init:
+ *
+ * Initializes GDK so that it can be used from multiple threads
+ * in conjunction with gdk_threads_enter() and gdk_threads_leave().
+ * If g_thread_init() has not yet been called, calls
+ * g_thread_init(NULL).
+ *
+ * This call must be made before any use of the main loop from
+ * GTK+; to be safe, call it before gtk_init().
+ **/
+void
+gdk_threads_init ()
+{
+ if (!g_thread_supported ())
+ g_thread_init (NULL);
+
+ gdk_threads_mutex = g_mutex_new ();
+}
+
G_CONST_RETURN char *
gdk_get_program_class (void)
{
void gdk_threads_enter (void);
void gdk_threads_leave (void);
+void gdk_threads_init (void);
#ifdef G_THREADS_ENABLED
# define GDK_THREADS_ENTER() G_STMT_START { \