tracker r2883 - in trunk: . src/libinotify



Author: mr
Date: Thu Feb  5 17:28:57 2009
New Revision: 2883
URL: http://svn.gnome.org/viewvc/tracker?rev=2883&view=rev

Log:
	* src/libinotify/inotify-monitor.c: (inotify_watch_func), Add main
	context iteration in the tight loop that is the event processing
	for libinotify. Attila's bug shows how spamming NOTIFY events
	means the libinotify code never returns back to the comfort of the
	main event loop. This means we never handle any timeouts or other
	event loop sources. I added an event loop iteration in there to
	make sure we always submit to the event loop in such conditions.


Modified:
   trunk/ChangeLog
   trunk/src/libinotify/inotify-monitor.c

Modified: trunk/src/libinotify/inotify-monitor.c
==============================================================================
--- trunk/src/libinotify/inotify-monitor.c	(original)
+++ trunk/src/libinotify/inotify-monitor.c	Thu Feb  5 17:28:57 2009
@@ -88,6 +88,11 @@
 
       size -= namesize;
 
+      /* Add some sort of yield to the main loop. */
+      while (g_main_context_pending (NULL)) {
+              g_main_context_iteration (NULL, FALSE);
+      }
+
       process_one_event( ine );
       memmove( ine, &ine[namesize], sizeof *ine * size );
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]