[tracker/tracker-0.10] libtracker-data: Protect cursor finalization with mutex
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] libtracker-data: Protect cursor finalization with mutex
- Date: Thu, 26 May 2011 10:28:02 +0000 (UTC)
commit accf74960968c4caad7c03c0e3f41a2863c802ed
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]