tags 403247 +patch
thanks

Hi,

Applying the other patch made by upstream seems to fix the problem.


I'm really not sure but I believe something like this is what was going on:
The FAMOpen2, call starts a server and retries 25 times to connect to the
server, every 50ms, giving a grand total of 1.25s top. On the other hand, if
the server is started on an nfs directory it seems to have an idle 1 sec lapse.
So, blame the scheduler or anything you can think of, but 0.25s wasn't enought
in most of the times to do the connection.  And thunar goes on without a
connection to the gam_server.

-- 
A computer scientist is someone who, when told to "Go to Hell,"
sees the "go to," rather than the destination, as harmful.
Saludos /\/\ /\ >< `/
diff -ruNa debian/gamin-0.1.8/server/gam_inotify.c gamin/server/gam_inotify.c
--- debian/gamin-0.1.8/server/gam_inotify.c	2006-10-25 13:13:46.000000000 -0300
+++ gamin/server/gam_inotify.c	2007-03-29 20:53:03.000000000 -0300
@@ -154,6 +154,7 @@
 gboolean
 gam_inotify_init (void)
 {
+	gam_poll_basic_init ();
 	gam_server_install_kernel_hooks (GAMIN_K_INOTIFY2, 
 					 gam_inotify_add_subscription,
 					 gam_inotify_remove_subscription,
diff -ruNa debian/gamin-0.1.8/server/gam_poll_basic.c gamin/server/gam_poll_basic.c
--- debian/gamin-0.1.8/server/gam_poll_basic.c	2005-09-21 13:21:04.000000000 -0300
+++ gamin/server/gam_poll_basic.c	2007-03-29 20:53:03.000000000 -0300
@@ -46,6 +46,8 @@
 static GaminEventType gam_poll_basic_poll_file(GamNode * node);
 static gboolean gam_poll_basic_scan_callback(gpointer data);
 
+static gboolean scan_callback_running = FALSE;
+
 gboolean
 gam_poll_basic_init ()
 {
@@ -56,7 +58,6 @@
 				       gam_poll_basic_remove_all_for,
 				       gam_poll_basic_poll_file);
 
-	g_timeout_add(1000, gam_poll_basic_scan_callback, NULL);
 	GAM_DEBUG(DEBUG_INFO, "basic poll backend initialized\n");
 	return TRUE;
 }
@@ -116,6 +117,12 @@
 
 	gam_poll_generic_add (node);
 
+	if (!scan_callback_running)
+	{
+	  scan_callback_running = TRUE;
+	  g_timeout_add (1000, gam_poll_basic_scan_callback, NULL);
+	}
+	
 	GAM_DEBUG(DEBUG_INFO, "Poll: added subscription for %s\n", path);
 	return TRUE;
 }
@@ -356,6 +363,7 @@
 gam_poll_basic_scan_callback(gpointer data)
 {
 	int idx;
+	gboolean did_something = FALSE;
 
 	gam_poll_generic_update_time ();
 
@@ -371,6 +379,8 @@
 
 		g_assert (node);
 
+		did_something = TRUE;
+		
 		if (node->is_dir) {
 			gam_poll_generic_scan_directory_internal(node);
 		} else {
@@ -391,6 +401,8 @@
 
 		g_assert (node);
 
+		did_something = TRUE;
+		
 #ifdef VERBOSE_POLL
 		GAM_DEBUG(DEBUG_INFO, "Checking missing file %s\n", node->path);
 #endif
@@ -412,5 +424,10 @@
 		}
 	}
 
+	if (!did_something) {
+	  scan_callback_running = FALSE;
+	  return FALSE;
+	}
+	
 	return TRUE;
 }

Reply via email to