[tracker] libtracker-data: Add ENABLE_MUTEXES TrackerDBManager initialization flag
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Add ENABLE_MUTEXES TrackerDBManager initialization flag
- Date: Sun, 20 Nov 2016 16:07:41 +0000 (UTC)
commit 8868839eef189f2fd0388c1ddac24b0039f3d773
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Nov 5 20:35:09 2016 +0100
libtracker-data: Add ENABLE_MUTEXES TrackerDBManager initialization flag
src/libtracker-data/tracker-db-interface-sqlite.c | 5 ++---
src/libtracker-data/tracker-db-manager.h | 3 ++-
src/libtracker-direct/tracker-direct.vala | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c
b/src/libtracker-data/tracker-db-interface-sqlite.c
index 62fcea5..083a15e 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -2520,9 +2520,8 @@ tracker_db_cursor_sqlite_new (TrackerDBStatement *ref_stmt,
cursor->finished = FALSE;
- /* used for direct access as libtracker-sparql is thread-safe and
- uses a single shared connection with SQLite mutex disabled */
- cursor->threadsafe = threadsafe;
+ cursor->threadsafe = (tracker_db_manager_get_flags (NULL, NULL) &
+ TRACKER_DB_MANAGER_ENABLE_MUTEXES) != 0;
cursor->stmt = ref_stmt->stmt;
ref_stmt->stmt_is_used = TRUE;
diff --git a/src/libtracker-data/tracker-db-manager.h b/src/libtracker-data/tracker-db-manager.h
index 396a13a..de0a48e 100644
--- a/src/libtracker-data/tracker-db-manager.h
+++ b/src/libtracker-data/tracker-db-manager.h
@@ -47,7 +47,8 @@ typedef enum {
/* 1 << 3 Was low mem mode */
TRACKER_DB_MANAGER_REMOVE_ALL = 1 << 4,
TRACKER_DB_MANAGER_READONLY = 1 << 5,
- TRACKER_DB_MANAGER_DO_NOT_CHECK_ONTOLOGY = 1 << 6
+ TRACKER_DB_MANAGER_DO_NOT_CHECK_ONTOLOGY = 1 << 6,
+ TRACKER_DB_MANAGER_ENABLE_MUTEXES = 1 << 7,
} TrackerDBManagerFlags;
GType tracker_db_get_type (void) G_GNUC_CONST;
diff --git a/src/libtracker-direct/tracker-direct.vala b/src/libtracker-direct/tracker-direct.vala
index a4f0d87..51499f3 100644
--- a/src/libtracker-direct/tracker-direct.vala
+++ b/src/libtracker-direct/tracker-direct.vala
@@ -36,7 +36,7 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
select_cache_size = int.parse (env_cache_size);
}
- Data.Manager.init (DBManagerFlags.READONLY, null, null, false, false,
select_cache_size, 0, null, null);
+ Data.Manager.init (DBManagerFlags.READONLY | DBManagerFlags.ENABLE_MUTEXES,
null, null, false, false, select_cache_size, 0, null, null);
}
use_count++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]