changeset 216:f7e17fb767eb

[gaim-migrate @ 226] Gtk-safe thread-safe code, here we come! Yah! committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 04 May 2000 09:32:51 +0000
parents 098ceea4133a
children fba779cc01f5
files configure.in src/aim.c src/rvous.c src/toc.c
diffstat 4 files changed, 12 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Wed May 03 22:31:49 2000 +0000
+++ b/configure.in	Thu May 04 09:32:51 2000 +0000
@@ -18,55 +18,6 @@
 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
 AC_CHECK_HEADERS(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not found ***]))
 
-dnl Taken from Mozilla's and xchat's configure.in's :)
-AC_CHECK_LIB(pthread, pthread_create, _PTHREAD_LDFLAGS="-lpthread",
-    AC_CHECK_LIB(c_r, pthread_create, _PTHREAD_LDFLAGS="-lc_r",
-        AC_CHECK_LIB(pthreads, pthread_create, _PTHREAD_LDFLAGS="-lpthreads",
-	    AC_MSG_ERROR([*** POSIX thread library not found ***])
-	)
-    )
-)
-dnl This is where it came straight from Mozilla.
-rm -f conftest*
-ac_cv_have_dash_pthread=no
-AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
-echo 'int main() { return 0; }' | cat > conftest.c
-${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
-if test $? -eq 0; then
-	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
-		ac_cv_have_dash_pthread=yes
-		CFLAGS="$CFLAGS -pthread"
-	fi
-fi
-rm -f conftest*
-case "$target" in
-	*-*-freebsd*)
-		AC_DEFINE(_REENTRANT)
-		AC_DEFINE(_THREAD_SAFE)
-		if test "$ac_cv_have_dash_pthread" = "yes"; then
-			_PTHREAD_LDFLAGS=""
-		else
-			_PTHREAD_LDFLAGS="-lc_r"
-		fi
-		;;
-	*-*-linux*)
-		AC_DEFINE(_REENTRANT)
-		;;
-	*-*-os2*)
-		_PTHREAD_LDFLAGS=
-		;;
-	alpha*-*-osf*)
-		AC_DEFINE(_REENTRANT)
-		;;
-	*-*-solaris*)
-		AC_DEFINE(_REENTRANT)
-		if test ! "$GNU_CC"; then
-			CFLAGS="$CFLAGS -mt"
-		fi
-		;;
-esac
-AC_MSG_RESULT($ac_cv_have_dash_pthread)
-
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_STRUCT_TM
@@ -88,7 +39,7 @@
 AC_ARG_ENABLE(plugins, [  --disable-plugins       compile with out plugin support],enable_plugins=no,enable_plugins=yes)
 
 GAIM_CFLAGS="$CFLAGS -I../"
-GAIM_LIBS="$LIBS $_PTHREAD_LDFLAGS"
+GAIM_LIBS="$LIBS"
 GAIM_LDADD="$LDADD"
 LIBFAIM_DO=""
 
@@ -102,16 +53,15 @@
         LIBFAIM_DO="libfaim.a"
 fi
 
+AM_PATH_GLIB(1.2.0)
+AM_PATH_GTK(1.2.0,,,gthread)
+GAIM_LIBS="$GAIM_LIBS $GTK_LIBS"
+
 if test "$enable_gnome" = yes ; then
 	GNOME_INIT(applets)
 	GNOME_X_CHECKS
         GAIM_CFLAGS="$GNOME_INCLUDEDIR $GAIM_CFLAGS -DUSE_APPLET"
-	GAIM_LIBS="$GAIM_LIBS $GNOME_LIBDIR $GTK_LIBS $GNOME_APPLETS_LIBS"
-else
-	AM_PATH_GLIB(1.2.0)
-	AM_PATH_GTK(1.2.0)
-	GAIM_LIBS="$GAIM_LIBS $GTK_LIBS"
-	
+	GAIM_LIBS="$GAIM_LIBS $GNOME_LIBDIR $GNOME_APPLETS_LIBS"
 fi
 
 GAIM_CFLAGS="$GAIM_CFLAGS $GTK_CFLAGS"
--- a/src/aim.c	Wed May 03 22:31:49 2000 +0000
+++ b/src/aim.c	Thu May 04 09:32:51 2000 +0000
@@ -29,6 +29,7 @@
 #endif /* USE_THEMES */
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
+#include <gdk/gdk.h>
 #include <unistd.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -473,6 +474,8 @@
 	if (general_options & OPT_GEN_DEBUG)
 		show_debug(NULL);
 
+	gdk_threads_enter();
+
 #ifdef USE_APPLET
 	applet_widget_register_callback(APPLET_WIDGET(applet),
 					"prefs",
@@ -508,6 +511,7 @@
         gtk_main();
         
 #endif /* USE_APPLET */
+	gdk_threads_leave();
         
 	return 0;
 	
--- a/src/rvous.c	Wed May 03 22:31:49 2000 +0000
+++ b/src/rvous.c	Thu May 04 09:32:51 2000 +0000
@@ -32,7 +32,6 @@
 #include <unistd.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <pthread.h>
 
 #include <gtk/gtk.h>
 #include "gaim.h"
--- a/src/toc.c	Wed May 03 22:31:49 2000 +0000
+++ b/src/toc.c	Thu May 04 09:32:51 2000 +0000
@@ -647,9 +647,11 @@
 	                for (i--; i >= 0; i--)
 	                        g_free(messages[i]);
                 
+			gdk_threads_enter();
 	                pthread_create(&thread, NULL, 
 				       (void*(*)(void*))accept_file_dialog, ft);
 			pthread_detach(thread);
+			gdk_threads_leave();
 		} else if (!strcmp(uuid, FILE_GET_UID)) {
 			/* we're sending a file */
 	                for (i=0; i<4; i++) {