summaryrefslogtreecommitdiff
path: root/src/txn/txn.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-08-19 12:04:55 +1000
committerKeith Bostic <keith@wiredtiger.com>2015-08-19 11:45:31 -0400
commitba32b71f75c85dd6ff3558346d19154d037888ec (patch)
tree3c3b90617c0a337f65d026bd13bc66ced3d0492d /src/txn/txn.c
parent1c2542ff9337af935ce95a63c91cd2024694634e (diff)
downloadmongo-ba32b71f75c85dd6ff3558346d19154d037888ec.tar.gz
Merge pull request #2112 from wiredtiger/wt-2025-inline-atomic-functions
WT-2025: inline atomic functions. (cherry picked from commit ada57c1ed44ab0dd4f904f60a63bbc77333b2baa)
Diffstat (limited to 'src/txn/txn.c')
-rw-r--r--src/txn/txn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/txn/txn.c b/src/txn/txn.c
index a391ec8be88..45be0a15a32 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -96,7 +96,7 @@ __wt_txn_get_snapshot(WT_SESSION_IMPL *session)
if ((count = txn_global->scan_count) < 0)
WT_PAUSE();
} while (count < 0 ||
- !WT_ATOMIC_CAS4(txn_global->scan_count, count, count + 1));
+ !__wt_atomic_casiv32(&txn_global->scan_count, count, count + 1));
current_id = snap_min = txn_global->current;
prev_oldest_id = txn_global->oldest_id;
@@ -109,7 +109,7 @@ __wt_txn_get_snapshot(WT_SESSION_IMPL *session)
/* Check that the oldest ID has not moved in the meantime. */
if (prev_oldest_id == txn_global->oldest_id) {
WT_ASSERT(session, txn_global->scan_count > 0);
- (void)WT_ATOMIC_SUB4(txn_global->scan_count, 1);
+ (void)__wt_atomic_subiv32(&txn_global->scan_count, 1);
return;
}
}
@@ -149,7 +149,7 @@ __wt_txn_get_snapshot(WT_SESSION_IMPL *session)
txn_global->last_running = snap_min;
WT_ASSERT(session, txn_global->scan_count > 0);
- (void)WT_ATOMIC_SUB4(txn_global->scan_count, 1);
+ (void)__wt_atomic_subiv32(&txn_global->scan_count, 1);
__txn_sort_snapshot(session, n, current_id);
}
@@ -203,7 +203,7 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, int force)
if ((count = txn_global->scan_count) < 0)
WT_PAUSE();
} while (count < 0 ||
- !WT_ATOMIC_CAS4(txn_global->scan_count, count, count + 1));
+ !__wt_atomic_casiv32(&txn_global->scan_count, count, count + 1));
/* The oldest ID cannot change until the scan count goes to zero. */
prev_oldest_id = txn_global->oldest_id;
@@ -251,7 +251,7 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, int force)
/* Update the oldest ID. */
if (TXNID_LT(prev_oldest_id, oldest_id) &&
- WT_ATOMIC_CAS4(txn_global->scan_count, 1, -1)) {
+ __wt_atomic_casiv32(&txn_global->scan_count, 1, -1)) {
WT_ORDERED_READ(session_cnt, conn->session_cnt);
for (i = 0, s = txn_global->states; i < session_cnt; i++, s++) {
if ((id = s->id) != WT_TXN_NONE &&
@@ -277,7 +277,7 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, int force)
oldest_session->txn.snap_min);
}
WT_ASSERT(session, txn_global->scan_count > 0);
- (void)WT_ATOMIC_SUB4(txn_global->scan_count, 1);
+ (void)__wt_atomic_subiv32(&txn_global->scan_count, 1);
}
}