summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2017-02-26 15:15:08 -0500
committerAndrew Morrow <acm@mongodb.com>2017-08-02 23:29:55 -0400
commita8a1ea3b9367adb6d0b65a7da21fed89598ea093 (patch)
tree8e969ed54b88c2a9c4c2d45a6518d053ac9f4265 /src/mongo/shell
parentc02c14e30d75b02894da116f4bb1a71652ead2b4 (diff)
downloadmongo-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')
-rw-r--r--src/mongo/shell/shell_utils.cpp7
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