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



commit 8bc04b23271f5fcd18a92cb5a8dec0057cab2342
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 4a6e619..a86e16a 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
@@ -2844,9 +2850,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]