diff src/gtk/transfer.c @ 33:c8ec7877432e

2002-10-06 Brian Masney <masneyb@gftp.org> * src/gtk/delete_dialog.c, src/gtk/gftp-gtk.c, src/gtk/misc-gtk.c, src/gtk/transfer.c - Fixed dead-locks with GDK_THREADS_{ENTER,LEAVE} * configure.in, src/gtk/Makefile.am - Use GTHREAD_LIBS 2002-10-03 Brian Masney <masneyb@gftp.org> * Makefile.am - remove intl and m4 directory from subdirs. autogen.sh will automagically add these for me. * autogen.sh - remove check for libtool * configure.in - link in gthread * cvsclean - added this script * *.[ch] - added $Id$ tags * debian/* - updated files from Debian maintainer
author masneyb
date Mon, 07 Oct 2002 10:40:43 +0000
parents d930e06af9ae
children bc9473ba9a90
line wrap: on
line diff
--- a/src/gtk/transfer.c	Thu Oct 03 12:06:18 2002 +0000
+++ b/src/gtk/transfer.c	Mon Oct 07 10:40:43 2002 +0000
@@ -18,6 +18,7 @@
 /*****************************************************************************/
 
 #include <gftp-gtk.h>
+static const char cvsid[] = "$Id$";
 
 static void *getdir_thread			( void *data );
 static void *connect_thread 			( void *data );
@@ -70,7 +71,9 @@
   void *success;
 
   gtk_label_set (GTK_LABEL (wdata->hoststxt), _("Receiving file names..."));
-  fix_display ();
+  if (gftp_is_started)
+    fix_display ();
+
   wdata->show_selected = 0;
   if (wdata->files == NULL)
     {
@@ -87,9 +90,8 @@
           pthread_create (&wdata->tid, NULL, getdir_thread, wdata->request);
           while (wdata->request->stopable)
             {
-              gdk_threads_leave ();
+              GDK_THREADS_LEAVE ();
               g_main_iteration (TRUE);
-              gdk_threads_enter ();
             }
           teardown_wakeup_main_thread (wdata->request, handler);
 
@@ -260,9 +262,8 @@
 
           while (request->stopable)
             {
-              gdk_threads_leave ();
+              GDK_THREADS_LEAVE ();
               g_main_iteration (TRUE);
-              gdk_threads_enter ();
             }
 
           if (GFTP_GET_PASSWORD (request) == NULL || 
@@ -284,9 +285,8 @@
       handler = setup_wakeup_main_thread (wdata->request);
       while (request->stopable)
         {
-          gdk_threads_leave ();
+          GDK_THREADS_LEAVE ();
           g_main_iteration (TRUE);
-          gdk_threads_enter ();
         }
       pthread_join (wdata->tid, &ret);
       teardown_wakeup_main_thread (wdata->request, handler);
@@ -450,9 +450,8 @@
 
           while (transfer->fromreq->stopable)
             {
-              gdk_threads_leave ();
+              GDK_THREADS_LEAVE ();
               g_main_iteration (TRUE);
-              gdk_threads_enter ();
             }
 
           gtk_timeout_remove (timeout_num);
@@ -1208,7 +1207,6 @@
   pthread_mutex_destroy (tdata->structmutex);
   pthread_mutex_destroy (tdata->statmutex);
   free_tdata (tdata);
-  fix_display ();
 }