From ba32b71f75c85dd6ff3558346d19154d037888ec Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Wed, 19 Aug 2015 12:04:55 +1000 Subject: Merge pull request #2112 from wiredtiger/wt-2025-inline-atomic-functions WT-2025: inline atomic functions. (cherry picked from commit ada57c1ed44ab0dd4f904f60a63bbc77333b2baa) --- src/txn/txn.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/txn/txn.c') 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); } } -- cgit v1.2.1