diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-04-18 13:28:34 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-04-20 16:39:01 +1000 |
commit | 2389dbb24ccad4a4eb06bd9418fc56d0da51f58c (patch) | |
tree | e76537633ab5103aa8201291c008c4806a36d9a0 /src/include/txn.h | |
parent | eb8080b6eeca88bd6c3ee1faf40d487067cab01c (diff) | |
download | mongo-2389dbb24ccad4a4eb06bd9418fc56d0da51f58c.tar.gz |
WT-2560 Use a rwlock to protect transaction state, don't spin.
Diffstat (limited to 'src/include/txn.h')
-rw-r--r-- | src/include/txn.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/txn.h b/src/include/txn.h index 1e82e2d982a..d10738cc670 100644 --- a/src/include/txn.h +++ b/src/include/txn.h @@ -74,7 +74,7 @@ struct __wt_txn_global { volatile uint64_t current; /* Current transaction ID. */ /* The oldest running transaction ID (may race). */ - uint64_t last_running; + volatile uint64_t last_running; /* * The oldest transaction ID that is not yet visible to some @@ -82,8 +82,11 @@ struct __wt_txn_global { */ volatile uint64_t oldest_id; - /* Count of scanning threads, or -1 for exclusive access. */ - volatile int32_t scan_count; + /* + * Prevents the oldest ID moving forwards while threads are scanning + * the global transaction state. + */ + WT_RWLOCK *scan_rwlock; /* * Track information about the running checkpoint. The transaction |