[tracker/tracker-0.10] libtracker-miner: Lower TrackerMinerFS idle priorities.



commit c473088a06e9c35267046b47d218c9c93c5cea3b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 3 14:59:46 2011 +0200

    libtracker-miner: Lower TrackerMinerFS idle priorities.
    
    This is so other events (timeouts, monitor events, ...) are
    guaranteed to be processed promptly while extraction is ongoing.

 src/libtracker-miner/tracker-miner-fs.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index e9078ef..7941fc0 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -100,6 +100,12 @@ static gboolean miner_fs_queues_status_trace_timeout_cb (gpointer data);
 #define DEFAULT_READY_POOL_LIMIT 1
 #define DEFAULT_N_REQUESTS_POOL_LIMIT 10
 
+/* Put tasks processing at a lower priority so other events
+ * (timeouts, monitor events, etc...) are guaranteed to be
+ * dispatched promptly.
+ */
+#define TRACKER_TASK_PRIORITY G_PRIORITY_DEFAULT_IDLE + 10
+
 /**
  * SECTION:tracker-miner-fs
  * @short_description: Abstract base class for filesystem miners
@@ -2832,9 +2838,9 @@ _tracker_idle_add (TrackerMinerFS *fs,
 	interval = MAX_TIMEOUT_INTERVAL * fs->priv->throttle;
 
 	if (interval == 0) {
-		return g_idle_add (func, user_data);
+		return g_idle_add_full (TRACKER_TASK_PRIORITY, func, user_data, NULL);
 	} else {
-		return g_timeout_add (interval, func, user_data);
+		return g_timeout_add_full (TRACKER_TASK_PRIORITY, interval, func, user_data, NULL);
 	}
 }
 



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