diff src/gtk/transfer.c @ 31:d930e06af9ae

2002-10-03 Brian Masney <masneyb@gftp.org> * src/gtk/gftp-gtk.c - call g_thread_init (NULL) * src/gtk/delete_dialog.c, src/gtk/misc-gtk.c, src/gtk/transfer.c - call gdk_threads_enter() and gdk_threads_leave()
author masneyb
date Thu, 03 Oct 2002 12:05:54 +0000
parents 3b2dcdefc7e9
children c8ec7877432e
line wrap: on
line diff
--- a/src/gtk/transfer.c	Sat Sep 28 17:32:23 2002 +0000
+++ b/src/gtk/transfer.c	Thu Oct 03 12:05:54 2002 +0000
@@ -86,7 +86,11 @@
           handler = setup_wakeup_main_thread (wdata->request);
           pthread_create (&wdata->tid, NULL, getdir_thread, wdata->request);
           while (wdata->request->stopable)
-            g_main_iteration (TRUE);
+            {
+              gdk_threads_leave ();
+              g_main_iteration (TRUE);
+              gdk_threads_enter ();
+            }
           teardown_wakeup_main_thread (wdata->request, handler);
 
           pthread_join (wdata->tid, &success);
@@ -253,8 +257,13 @@
                           0, NULL, gftp_dialog_button_connect, 
                           try_connect_again, request, 
                           dont_connect_again, request);
+
           while (request->stopable)
-            g_main_iteration (TRUE);
+            {
+              gdk_threads_leave ();
+              g_main_iteration (TRUE);
+              gdk_threads_enter ();
+            }
 
           if (GFTP_GET_PASSWORD (request) == NULL || 
               *GFTP_GET_PASSWORD (request) == '\0')
@@ -274,7 +283,11 @@
 
       handler = setup_wakeup_main_thread (wdata->request);
       while (request->stopable)
-        g_main_iteration (TRUE); 
+        {
+          gdk_threads_leave ();
+          g_main_iteration (TRUE);
+          gdk_threads_enter ();
+        }
       pthread_join (wdata->tid, &ret);
       teardown_wakeup_main_thread (wdata->request, handler);
 
@@ -436,7 +449,11 @@
           timeout_num = gtk_timeout_add (100, progress_timeout, transfer);
 
           while (transfer->fromreq->stopable)
-            g_main_iteration (TRUE);
+            {
+              gdk_threads_leave ();
+              g_main_iteration (TRUE);
+              gdk_threads_enter ();
+            }
 
           gtk_timeout_remove (timeout_num);
           transfer->numfiles = transfer->numdirs = -1;