Replaced `THREAD_LOCAL` with `thread_local` in stout. Review: https://reviews.apache.org/r/58313
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5cfab775 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5cfab775 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5cfab775 Branch: refs/heads/master Commit: 5cfab7752ddac1581dea1451bb596acea09f10b2 Parents: 305c546 Author: Neil Conway <[email protected]> Authored: Mon Apr 10 09:45:07 2017 -0700 Committer: Neil Conway <[email protected]> Committed: Wed May 3 14:19:42 2017 -0700 ---------------------------------------------------------------------- 3rdparty/stout/include/stout/os/windows/mkdtemp.hpp | 3 +-- 3rdparty/stout/include/stout/uuid.hpp | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/5cfab775/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp b/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp index ef6a78a..9181429 100644 --- a/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp +++ b/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp @@ -26,7 +26,6 @@ #include <stout/nothing.hpp> #include <stout/path.hpp> #include <stout/strings.hpp> -#include <stout/thread_local.hpp> #include <stout/try.hpp> #include <stout/os/mkdir.hpp> @@ -67,7 +66,7 @@ inline Try<std::string> mkdtemp( static const size_t maxAlphabetIndex = sizeof(alphabet) - 2; std::string postfix(postfixTemplate); - static THREAD_LOCAL std::mt19937 generator((std::random_device())()); + static thread_local std::mt19937 generator((std::random_device())()); for (int i = 0; i < postfixSize; ++i) { int index = generator() % maxAlphabetIndex; http://git-wip-us.apache.org/repos/asf/mesos/blob/5cfab775/3rdparty/stout/include/stout/uuid.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/uuid.hpp b/3rdparty/stout/include/stout/uuid.hpp index b84299c..1683084 100644 --- a/3rdparty/stout/include/stout/uuid.hpp +++ b/3rdparty/stout/include/stout/uuid.hpp @@ -24,7 +24,6 @@ #include <boost/uuid/uuid_io.hpp> #include <stout/error.hpp> -#include <stout/thread_local.hpp> #include <stout/try.hpp> #ifdef __WINDOWS__ @@ -43,7 +42,7 @@ struct UUID : boost::uuids::uuid public: static UUID random() { - static THREAD_LOCAL boost::uuids::random_generator* generator = nullptr; + static thread_local boost::uuids::random_generator* generator = nullptr; if (generator == nullptr) { generator = new boost::uuids::random_generator(); @@ -73,7 +72,7 @@ public: static Try<UUID> fromString(const std::string& s) { try { - // NOTE: We don't use THREAD_LOCAL for the `string_generator` + // NOTE: We don't use `thread_local` for the `string_generator` // (unlike for the `random_generator` above), because it is cheap // to construct one each time. boost::uuids::string_generator gen;
