summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-09-15 11:15:02 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-09-22 10:51:18 -0400
commit1f6d501989875dac4bcd7cffbbabf320c3cab289 (patch)
tree9d029f2d6a03006cb546c5abb8e20f10b0c92ee4 /src/mongo/db/fts
parent230005e3ac47b6278e22144af8d9ce417e3e1aa2 (diff)
downloadmongo-1f6d501989875dac4bcd7cffbbabf320c3cab289.tar.gz
SERVER-20096: ExportedServerParameter<T> is not thread-safe for parameters changeable at runtime.
Diffstat (limited to 'src/mongo/db/fts')
-rw-r--r--src/mongo/db/fts/fts_enabled.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/fts/fts_enabled.cpp b/src/mongo/db/fts/fts_enabled.cpp
index fb261194db1..61c700f513b 100644
--- a/src/mongo/db/fts/fts_enabled.cpp
+++ b/src/mongo/db/fts/fts_enabled.cpp
@@ -38,7 +38,7 @@ namespace mongo {
namespace fts {
namespace {
-bool dummyEnabledFlag = true; // Unused, needed for server parameter.
+std::atomic<bool> dummyEnabledFlag(true); // Unused, needed for server parameter.
/**
* Declaration for the "textSearchEnabled" server parameter, which is now deprecated.
@@ -46,12 +46,12 @@ bool dummyEnabledFlag = true; // Unused, needed for server parameter.
* - setting to true performs a no-op and logs a deprecation message.
* - setting to false will fail.
*/
-class ExportedTextSearchEnabledParameter : public ExportedServerParameter<bool> {
+class ExportedTextSearchEnabledParameter
+ : public ExportedServerParameter<bool, ServerParameterType::kStartupAndRuntime> {
public:
ExportedTextSearchEnabledParameter()
- : ExportedServerParameter<bool>(
- ServerParameterSet::getGlobal(), "textSearchEnabled", &dummyEnabledFlag, true, true) {
- }
+ : ExportedServerParameter<bool, ServerParameterType::kStartupAndRuntime>(
+ ServerParameterSet::getGlobal(), "textSearchEnabled", &dummyEnabledFlag) {}
virtual Status validate(const bool& potentialNewValue) {
if (!potentialNewValue) {