summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2017-01-05 10:56:41 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2017-01-05 10:56:41 -0500
commitba55f2573976ba570c2319bce9b598f0a660445f (patch)
tree7fc8adb43798e03517933c4e575dcbebe8f42087 /src/mongo/db/storage
parentf5fbf31650eea903edbbcd2f9ef042b4c39e2ecb (diff)
downloadmongo-ba55f2573976ba570c2319bce9b598f0a660445f.tar.gz
SERVER-25932 Make MONGO_EXPORT_SERVER_PARAMETER use AtomicWord instead of std::atomic
Diffstat (limited to 'src/mongo/db/storage')
-rw-r--r--src/mongo/db/storage/mmap_v1/dur.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp2
-rw-r--r--src/mongo/db/storage/storage_options.h5
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp4
4 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp
index 1ed88c8d117..ab1d1988cba 100644
--- a/src/mongo/db/storage/mmap_v1/dur.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur.cpp
@@ -498,7 +498,7 @@ void Stats::S::_asObj(BSONObjBuilder* builder) const {
<< "commitsInWriteLock"
<< (unsigned)(_commitsInWriteLockMicros / 1000));
- if (storageGlobalParams.journalCommitIntervalMs != 0) {
+ if (storageGlobalParams.journalCommitIntervalMs.load() != 0) {
b << "journalCommitIntervalMs" << storageGlobalParams.journalCommitIntervalMs.load();
}
}
@@ -686,7 +686,7 @@ static void durThread(ClockSource* cs, int64_t serverStartMs) {
uint64_t remapLastTimestamp(0);
while (shutdownRequested.loadRelaxed() == 0) {
- unsigned ms = storageGlobalParams.journalCommitIntervalMs;
+ unsigned ms = storageGlobalParams.journalCommitIntervalMs.load();
if (ms == 0) {
ms = samePartition ? 100 : 30;
}
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp
index 3d2a0f3a290..cd503957176 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp
@@ -69,7 +69,7 @@ namespace {
* - setting to false will fail.
*/
// Unused, needed for server parameter.
-std::atomic<bool> newCollectionsUsePowerOf2SizesFlag(true); // NOLINT
+AtomicBool newCollectionsUsePowerOf2SizesFlag(true);
class NewCollectionsUsePowerOf2SizesParameter
: public ExportedServerParameter<bool, ServerParameterType::kStartupAndRuntime> {
diff --git a/src/mongo/db/storage/storage_options.h b/src/mongo/db/storage/storage_options.h
index 8ae1467e307..d1fd1c24fb2 100644
--- a/src/mongo/db/storage/storage_options.h
+++ b/src/mongo/db/storage/storage_options.h
@@ -32,6 +32,7 @@
#include <string>
#include "mongo/platform/atomic_proxy.h"
+#include "mongo/platform/atomic_word.h"
/*
* This file defines the storage for options that come from the command line related to data file
@@ -81,11 +82,11 @@ struct StorageGlobalParams {
// --journalCommitInterval
static const int kMaxJournalCommitIntervalMs;
- std::atomic<int> journalCommitIntervalMs; // NOLINT
+ AtomicInt32 journalCommitIntervalMs;
// --notablescan
// no table scans allowed
- std::atomic<bool> noTableScan{false}; // NOLINT
+ AtomicBool noTableScan{false};
// --directoryperdb
// Stores each database’s files in its own folder in the data directory.
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 8dc0fac9443..4229aa4d572 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -108,7 +108,7 @@ public:
invariant(e.getCode() == ErrorCodes::ShutdownInProgress);
}
- int ms = storageGlobalParams.journalCommitIntervalMs;
+ int ms = storageGlobalParams.journalCommitIntervalMs.load();
if (!ms) {
ms = 100;
}
@@ -125,7 +125,7 @@ public:
private:
WiredTigerSessionCache* _sessionCache;
- std::atomic<bool> _shuttingDown{false}; // NOLINT
+ AtomicBool _shuttingDown{false};
};
namespace {