[tracker] libtracker-db: Use atomic get_int instead of compare
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-db: Use atomic get_int instead of compare
- Date: Wed, 26 May 2010 11:23:15 +0000 (UTC)
commit 50dba92c96a7c9661e999a40e0086b387c7a8330
Author: Philip Van Hoof <philip codeminded be>
Date: Wed May 26 13:03:40 2010 +0200
libtracker-db: Use atomic get_int instead of compare
Because we reset the flag now, it's not needed to set to 0 after
the check
src/libtracker-db/tracker-db-interface-sqlite.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index a65e151..20b2b13 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -492,7 +492,7 @@ static int
check_interrupt (void *user_data)
{
TrackerDBInterfaceSqlitePrivate *priv = user_data;
- return g_atomic_int_compare_and_exchange (&priv->interrupt, 1, 0);
+ return g_atomic_int_get (&priv->interrupt);
}
static void
@@ -1216,7 +1216,7 @@ tracker_db_cursor_sqlite_iter_next (TrackerDBCursor *cursor,
if (!priv->finished) {
guint result;
- if (g_atomic_int_compare_and_exchange (&iface_priv->interrupt, 1, 0)) {
+ if (g_atomic_int_get (&iface_priv->interrupt) == 1) {
result = SQLITE_INTERRUPT;
sqlite3_reset (priv->stmt);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]