diff options
author | Andrew Morrow <acm@mongodb.com> | 2017-02-26 15:15:08 -0500 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2017-08-02 23:29:55 -0400 |
commit | a8a1ea3b9367adb6d0b65a7da21fed89598ea093 (patch) | |
tree | 8e969ed54b88c2a9c4c2d45a6518d053ac9f4265 /src/mongo/shell/shell_utils.cpp | |
parent | c02c14e30d75b02894da116f4bb1a71652ead2b4 (diff) | |
download | mongo-a8a1ea3b9367adb6d0b65a7da21fed89598ea093.tar.gz |
SERVER-26538 SERVER-26539 Detach from boost::thread
Also, use thread_local everywhere for our thread specific data needs
and remove the legacy support.
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r-- | src/mongo/shell/shell_utils.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp index d0189a75432..8f42252871f 100644 --- a/src/mongo/shell/shell_utils.cpp +++ b/src/mongo/shell/shell_utils.cpp @@ -43,7 +43,6 @@ #include "mongo/shell/shell_options.h" #include "mongo/shell/shell_utils_extended.h" #include "mongo/shell/shell_utils_launcher.h" -#include "mongo/util/concurrency/threadlocal.h" #include "mongo/util/log.h" #include "mongo/util/processinfo.h" #include "mongo/util/quick_exit.h" @@ -113,7 +112,7 @@ BSONObj JSGetMemInfo(const BSONObj& args, void* data) { } #if !defined(_WIN32) -ThreadLocalValue<unsigned int> _randomSeed; +thread_local unsigned int _randomSeed = 0; #endif BSONObj JSSrand(const BSONObj& a, void* data) { @@ -127,7 +126,7 @@ BSONObj JSSrand(const BSONObj& a, void* data) { seed = static_cast<unsigned int>(rand->nextInt64()); } #if !defined(_WIN32) - _randomSeed.set(seed); + _randomSeed = seed; #else srand(seed); #endif @@ -138,7 +137,7 @@ BSONObj JSRand(const BSONObj& a, void* data) { uassert(12519, "rand accepts no arguments", a.nFields() == 0); unsigned r; #if !defined(_WIN32) - r = rand_r(&_randomSeed.getRef()); + r = rand_r(&_randomSeed); #else r = rand(); #endif |