[tracker/rss-enclosures] TrackerStore: Keep a list of running tasks.
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] TrackerStore: Keep a list of running tasks.
- Date: Mon, 3 May 2010 00:39:12 +0000 (UTC)
commit ca61e5b485af7f1d2d1a12f1c08778c020ae3c50
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Apr 16 14:09:34 2010 +0200
TrackerStore: Keep a list of running tasks.
These are removed from the queue as soon as they start processing, so keep them
elsewhere in order to have cancellation work.
src/tracker-store/tracker-store.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-store/tracker-store.c b/src/tracker-store/tracker-store.c
index dd1b9d0..0fa7bac 100644
--- a/src/tracker-store/tracker-store.c
+++ b/src/tracker-store/tracker-store.c
@@ -47,6 +47,7 @@ typedef struct {
gboolean update_running;
GThreadPool *main_pool;
GThreadPool *global_pool;
+ GSList *running_tasks;
} TrackerStorePrivate;
typedef enum {
@@ -279,6 +280,7 @@ task_finish_cb (gpointer data)
g_clear_error (&task->error);
}
+ private->running_tasks = g_slist_remove (private->running_tasks, task);
private->n_queries_running--;
} else if (task->type == TRACKER_STORE_TASK_TYPE_UPDATE) {
if (!task->data.update.batch && !task->error) {
@@ -435,6 +437,7 @@ queue_idle_handler (gpointer user_data)
/* pop task now, otherwise further queries won't be scheduled */
g_queue_pop_head (queue);
+ private->running_tasks = g_slist_prepend (private->running_tasks, task);
private->n_queries_running++;
task_run_async (private, task);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]