From a8a1ea3b9367adb6d0b65a7da21fed89598ea093 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Sun, 26 Feb 2017 15:15:08 -0500 Subject: SERVER-26538 SERVER-26539 Detach from boost::thread Also, use thread_local everywhere for our thread specific data needs and remove the legacy support. --- src/mongo/shell/shell_utils.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mongo/shell') 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 _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(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 -- cgit v1.2.1