tracker r1459 - in branches/indexer-split: . src/trackerd
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1459 - in branches/indexer-split: . src/trackerd
- Date: Tue, 20 May 2008 11:22:51 +0000 (UTC)
Author: mr
Date: Tue May 20 11:22:51 2008
New Revision: 1459
URL: http://svn.gnome.org/viewvc/tracker?rev=1459&view=rev
Log:
* src/trackerd/tracker-main.[ch]:
* src/trackerd/tracker-process-files.c: Moved the
tracker->dir_queue to tracker-process-files.c since it is only
used there.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/trackerd/tracker-main.c
branches/indexer-split/src/trackerd/tracker-main.h
branches/indexer-split/src/trackerd/tracker-process-files.c
Modified: branches/indexer-split/src/trackerd/tracker-main.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-main.c (original)
+++ branches/indexer-split/src/trackerd/tracker-main.c Tue May 20 11:22:51 2008
@@ -874,7 +874,6 @@
tracker = g_new0 (Tracker, 1);
tracker->pid = getpid ();
- tracker->dir_queue = g_async_queue_new ();
tracker->max_process_queue_size = MAX_PROCESS_QUEUE_SIZE;
tracker->max_extract_queue_size = MAX_EXTRACT_QUEUE_SIZE;
@@ -1077,10 +1076,6 @@
g_async_queue_unref (tracker->file_metadata_queue);
}
- if (tracker->dir_queue) {
- g_async_queue_unref (tracker->dir_queue);
- }
-
return EXIT_SUCCESS;
}
Modified: branches/indexer-split/src/trackerd/tracker-main.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-main.h (original)
+++ branches/indexer-split/src/trackerd/tracker-main.h Tue May 20 11:22:51 2008
@@ -117,7 +117,6 @@
GAsyncQueue *file_process_queue;
GAsyncQueue *file_metadata_queue;
- GAsyncQueue *dir_queue;
GMutex *files_check_mutex;
GMutex *files_signal_mutex;
Modified: branches/indexer-split/src/trackerd/tracker-process-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-process-files.c (original)
+++ branches/indexer-split/src/trackerd/tracker-process-files.c Tue May 20 11:22:51 2008
@@ -52,6 +52,8 @@
#include "tracker-status.h"
#include "tracker-process-files.h"
+static GAsyncQueue *dir_queue;
+
static GSList *ignore_pattern_list;
static GSList *temp_black_list;
static GSList *crawl_directories;
@@ -1104,10 +1106,10 @@
/* Check dir_queue in case there are
* directories waiting to be indexed.
*/
- if (g_async_queue_length (tracker->dir_queue) > 0) {
+ if (g_async_queue_length (dir_queue) > 0) {
gchar *uri;
- uri = g_async_queue_try_pop (tracker->dir_queue);
+ uri = g_async_queue_try_pop (dir_queue);
if (uri) {
process_check_directory (tracker, uri);
@@ -1291,7 +1293,7 @@
case TRACKER_DB_ACTION_DIRECTORY_REFRESH:
if (need_index &&
tracker_process_files_should_be_watched (tracker->config, info->uri)) {
- g_async_queue_push (tracker->dir_queue, g_strdup (info->uri));
+ g_async_queue_push (dir_queue, g_strdup (info->uri));
if (tracker_index_stage_get () != TRACKER_INDEX_STAGE_EMAILS) {
tracker->folders_count++;
@@ -1304,7 +1306,7 @@
case TRACKER_DB_ACTION_DIRECTORY_CHECK:
if (need_index &&
tracker_process_files_should_be_watched (tracker->config, info->uri)) {
- g_async_queue_push (tracker->dir_queue, g_strdup (info->uri));
+ g_async_queue_push (dir_queue, g_strdup (info->uri));
if (info->indextime > 0) {
process_index_delete_directory_check (tracker, info->uri, db_con);
@@ -1501,25 +1503,31 @@
gpointer
tracker_process_files (gpointer data)
{
- DBConnection *db_con = tracker_db_connect_all ();
- Tracker *tracker;
- GObject *object;
- GSList *moved_from_list; /* List to hold moved_from
- * events whilst waiting for a
- * matching moved_to event.
- */
- gboolean pushed_events;
- gboolean first_run;
- gint initial_sleep;
+ Tracker *tracker;
+ DBConnection *db_con;
+ GObject *object;
+ GSList *moved_from_list; /* List to hold moved_from
+ * events whilst waiting for a
+ * matching moved_to event.
+ */
+ gboolean pushed_events;
+ gboolean first_run;
+ gint initial_sleep;
+ /* Set up thread */
process_block_signals ();
- object = tracker_dbus_get_object (TRACKER_TYPE_DBUS_DAEMON);
-
tracker = (Tracker*) data;
+ /* Lock this process */
g_mutex_lock (tracker->files_signal_mutex);
+ /* Get pointers we need */
+ db_con = tracker_db_connect_all ();
+ object = tracker_dbus_get_object (TRACKER_TYPE_DBUS_DAEMON);
+
+ dir_queue = g_async_queue_new ();
+
tracker->pause_io = TRUE;
/* When initially run, we set up variables */
@@ -1753,11 +1761,15 @@
tracker_db_close_all (db_con);
+ /* Clean up */
+ if (dir_queue) {
+ g_async_queue_unref (dir_queue);
+ }
+
g_mutex_unlock (tracker->files_signal_mutex);
g_message ("Process thread now finishing");
- g_thread_exit (NULL);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]