From: <ebl...@us...> - 2006-08-14 21:46:24
|
Revision: 16759 Author: eblanton Date: 2006-08-14 14:46:17 -0700 (Mon, 14 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16759&view=rev Log Message: ----------- This initializes threads for glib and dbus, because under some circumstances multithreaded libraries are causing dbus badness (namely, gnome-vfs). This fix doesn't really belong in Gaim, but in the interest of expedience (we don't want to wait for upstream libraries to get their initializations all worked around to make things safe) the fix goes here. Note that all Gaim frontends will have to initialize glib threads if other threaded libraries which interact with glib or dbus or what-have-you come into play. Modified Paths: -------------- trunk/configure.ac trunk/src/Makefile.am trunk/src/dbus-server.c trunk/src/gtkmain.c Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/configure.ac 2006-08-14 21:46:17 UTC (rev 16759) @@ -636,7 +636,7 @@ AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([ *** GLib 2.0 is required to build Gaim; please make sure you have the GLib *** development headers installed. The latest version of GLib is -*** always available at http://www.gtk.org/.])) +*** always available at http://www.gtk.org/.]),gthread) AM_PATH_GTK_2_0(2.0.0,,AC_MSG_ERROR([ *** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+ *** development headers installed. The latest version of GTK+ is Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/src/Makefile.am 2006-08-14 21:46:17 UTC (rev 16759) @@ -339,6 +339,7 @@ gaim_LDFLAGS = -export-dynamic gaim_LDADD = \ @LIBOBJS@ \ + $(GLIB_LIBS) \ $(GTK_LIBS) \ $(DBUS_LIBS) \ $(GSTREAMER_LIBS) \ Modified: trunk/src/dbus-server.c =================================================================== --- trunk/src/dbus-server.c 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/src/dbus-server.c 2006-08-14 21:46:17 UTC (rev 16759) @@ -757,6 +757,9 @@ void gaim_dbus_init(void) { + if (g_thread_supported()) + dbus_g_thread_init(); + gaim_dbus_init_ids(); g_free(init_error); Modified: trunk/src/gtkmain.c =================================================================== --- trunk/src/gtkmain.c 2006-08-14 16:07:20 UTC (rev 16758) +++ trunk/src/gtkmain.c 2006-08-14 21:46:17 UTC (rev 16759) @@ -643,6 +643,15 @@ gtk_rc_add_default_file(search_path); g_free(search_path); +#if (defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)) + /* Since threads can be yanked in all unawares by other libraries, + * and some libraries aren't smart enough to initialize the thread + * subsystem when they need it, we need to do this here. We also + * threadify dbus when that gets initialized. Ugh. */ + if (!g_thread_supported()) + g_thread_init(NULL); + gdk_threads_init(); +#endif /* Glib has threads */ gui_check = gtk_init_check(&argc, &argv); if (!gui_check) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |