[tracker] libtracker-data: Protect cursor finalization with mutex



commit 227ffbfa65d8c3be49fe56bd05e5a4f2b697451c
Author: Jürg Billeter <j bitron ch>
Date:   Fri May 20 11:31:40 2011 +0200

    libtracker-data: Protect cursor finalization with mutex
    
    This is necessary for parallel queries with direct access.
    
    Fixes NB#244556.

 src/libtracker-data/tracker-db-interface-sqlite.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c
index 0e06110..0abb164 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -1561,10 +1561,18 @@ tracker_db_cursor_finalize (GObject *object)
 	}
 	g_free (cursor->variable_names);
 
+	if (cursor->threadsafe) {
+		tracker_db_manager_lock ();
+	}
+
 	cursor->ref_stmt->stmt_is_sunk = FALSE;
 	tracker_db_statement_sqlite_reset (cursor->ref_stmt);
 	g_object_unref (cursor->ref_stmt);
 
+	if (cursor->threadsafe) {
+		tracker_db_manager_unlock ();
+	}
+
 	G_OBJECT_CLASS (tracker_db_cursor_parent_class)->finalize (object);
 }
 



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