[tracker/async-queries-due] TrackerStore: Keep a list of running tasks.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/async-queries-due] TrackerStore: Keep a list of running tasks.
- Date: Fri, 16 Apr 2010 12:16:30 +0000 (UTC)
commit 3343226830776e74b8f15d5ee52f49e5f61f8393
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]