You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ne...@apache.org on 2017/05/03 21:27:57 UTC

[1/5] mesos git commit: Removed workaround for lack of `thread_local` on OS X.

Repository: mesos
Updated Branches:
  refs/heads/master 4f4aff955 -> 310c0d62d


Removed workaround for lack of `thread_local` on OS X.

Until XCode 8, Apple's build toolchain did not support the
`thread_local` feature from C++11. Hence, Stout provided a
`THREAD_LOCAL` macro, which expanded to `__thread` on OS X and
`thread_local` on other platforms.

XCode 8 added support for `thread_local`, so we can remove this
workaround. Note that XCode 8 requires OS X 10.11.5 or newer.

Review: https://reviews.apache.org/r/58310


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7e8b4e42
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7e8b4e42
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7e8b4e42

Branch: refs/heads/master
Commit: 7e8b4e4286d336063845949bd0148d03481d754c
Parents: 4f4aff9
Author: Neil Conway <ne...@gmail.com>
Authored: Mon Apr 10 09:32:03 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Wed May 3 14:19:26 2017 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/thread_local.hpp | 11 -----------
 1 file changed, 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7e8b4e42/3rdparty/stout/include/stout/thread_local.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/thread_local.hpp b/3rdparty/stout/include/stout/thread_local.hpp
index 7ffc809..dacf212 100644
--- a/3rdparty/stout/include/stout/thread_local.hpp
+++ b/3rdparty/stout/include/stout/thread_local.hpp
@@ -13,17 +13,6 @@
 #ifndef __STOUT_THREAD_LOCAL_HPP__
 #define __STOUT_THREAD_LOCAL_HPP__
 
-// A wrapper around the thread local storage attribute. The default
-// clang on OSX does not support the c++11 standard `thread_local`
-// intentionally until a higher performance implementation is
-// released. See https://devforums.apple.com/message/1079348#1079348
-// Until then, we use `__thread` on OSX instead.
-// We required that THREAD_LOCAL is only used with POD types as this
-// is a requirement of `__thread`.
-#ifdef __APPLE__
-#define THREAD_LOCAL __thread
-#else
 #define THREAD_LOCAL thread_local
-#endif
 
 #endif // __STOUT_THREAD_LOCAL_HPP__


[3/5] mesos git commit: Replaced `THREAD_LOCAL` with `thread_local` in libprocess.

Posted by ne...@apache.org.
Replaced `THREAD_LOCAL` with `thread_local` in libprocess.

Review: https://reviews.apache.org/r/58312


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/305c5462
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/305c5462
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/305c5462

Branch: refs/heads/master
Commit: 305c5462b73600454d8bcfa4535e8b69b0d255a9
Parents: 242f58b
Author: Neil Conway <ne...@gmail.com>
Authored: Mon Apr 10 09:44:42 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Wed May 3 14:19:37 2017 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/executor.hpp | 4 +---
 3rdparty/libprocess/include/process/process.hpp  | 3 +--
 3rdparty/libprocess/src/libev.cpp                | 3 +--
 3rdparty/libprocess/src/libev.hpp                | 3 +--
 3rdparty/libprocess/src/libevent.cpp             | 3 +--
 3rdparty/libprocess/src/libevent.hpp             | 3 +--
 3rdparty/libprocess/src/process.cpp              | 9 ++++-----
 7 files changed, 10 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/305c5462/3rdparty/libprocess/include/process/executor.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/executor.hpp b/3rdparty/libprocess/include/process/executor.hpp
index 7faa2ab..cd2f2f0 100644
--- a/3rdparty/libprocess/include/process/executor.hpp
+++ b/3rdparty/libprocess/include/process/executor.hpp
@@ -17,8 +17,6 @@
 #include <process/id.hpp>
 #include <process/process.hpp>
 
-#include <stout/thread_local.hpp>
-
 namespace process {
 
 // Provides an abstraction that can take a standard function object
@@ -67,7 +65,7 @@ private:
 
 // Per thread executor pointer. We use a pointer to lazily construct the
 // actual executor.
-extern THREAD_LOCAL Executor* _executor_;
+extern thread_local Executor* _executor_;
 
 #define __executor__                                                    \
   (_executor_ == nullptr ? _executor_ = new Executor() : _executor_)

http://git-wip-us.apache.org/repos/asf/mesos/blob/305c5462/3rdparty/libprocess/include/process/process.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/process.hpp b/3rdparty/libprocess/include/process/process.hpp
index 401510c..944fcc6 100644
--- a/3rdparty/libprocess/include/process/process.hpp
+++ b/3rdparty/libprocess/include/process/process.hpp
@@ -35,7 +35,6 @@
 #include <stout/lambda.hpp>
 #include <stout/option.hpp>
 #include <stout/synchronized.hpp>
-#include <stout/thread_local.hpp>
 
 namespace process {
 
@@ -682,7 +681,7 @@ inline bool wait(const ProcessBase* process, const Duration& duration)
 
 
 // Per thread process pointer.
-extern THREAD_LOCAL ProcessBase* __process__;
+extern thread_local ProcessBase* __process__;
 
 // NOTE: Methods in this namespace should only be used in tests to
 // inject arbitrary events.

http://git-wip-us.apache.org/repos/asf/mesos/blob/305c5462/3rdparty/libprocess/src/libev.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libev.cpp b/3rdparty/libprocess/src/libev.cpp
index 8db9c3b..07717c4 100644
--- a/3rdparty/libprocess/src/libev.cpp
+++ b/3rdparty/libprocess/src/libev.cpp
@@ -18,7 +18,6 @@
 #include <stout/duration.hpp>
 #include <stout/lambda.hpp>
 #include <stout/nothing.hpp>
-#include <stout/thread_local.hpp>
 
 #include "event_loop.hpp"
 #include "libev.hpp"
@@ -40,7 +39,7 @@ std::mutex* watchers_mutex = new std::mutex();
 std::queue<lambda::function<void()>>* functions =
   new std::queue<lambda::function<void()>>();
 
-THREAD_LOCAL bool* _in_event_loop_ = nullptr;
+thread_local bool* _in_event_loop_ = nullptr;
 
 
 void handle_async(struct ev_loop* loop, ev_async* _, int revents)

http://git-wip-us.apache.org/repos/asf/mesos/blob/305c5462/3rdparty/libprocess/src/libev.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libev.hpp b/3rdparty/libprocess/src/libev.hpp
index 2e67967..d451931 100644
--- a/3rdparty/libprocess/src/libev.hpp
+++ b/3rdparty/libprocess/src/libev.hpp
@@ -23,7 +23,6 @@
 
 #include <stout/lambda.hpp>
 #include <stout/synchronized.hpp>
-#include <stout/thread_local.hpp>
 
 namespace process {
 
@@ -47,7 +46,7 @@ extern std::queue<lambda::function<void()>>* functions;
 
 // Per thread bool pointer. We use a pointer to lazily construct the
 // actual bool.
-extern THREAD_LOCAL bool* _in_event_loop_;
+extern thread_local bool* _in_event_loop_;
 
 #define __in_event_loop__ *(_in_event_loop_ == nullptr ?                \
   _in_event_loop_ = new bool(false) : _in_event_loop_)

http://git-wip-us.apache.org/repos/asf/mesos/blob/305c5462/3rdparty/libprocess/src/libevent.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent.cpp b/3rdparty/libprocess/src/libevent.cpp
index 093569e..eb3998c 100644
--- a/3rdparty/libprocess/src/libevent.cpp
+++ b/3rdparty/libprocess/src/libevent.cpp
@@ -24,7 +24,6 @@
 #include <process/once.hpp>
 
 #include <stout/synchronized.hpp>
-#include <stout/thread_local.hpp>
 
 #include "event_loop.hpp"
 #include "libevent.hpp"
@@ -39,7 +38,7 @@ std::queue<lambda::function<void()>>* functions =
   new std::queue<lambda::function<void()>>();
 
 
-THREAD_LOCAL bool* _in_event_loop_ = nullptr;
+thread_local bool* _in_event_loop_ = nullptr;
 
 
 void async_function(evutil_socket_t socket, short which, void* arg)

http://git-wip-us.apache.org/repos/asf/mesos/blob/305c5462/3rdparty/libprocess/src/libevent.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent.hpp b/3rdparty/libprocess/src/libevent.hpp
index e7f273e..2eb9790 100644
--- a/3rdparty/libprocess/src/libevent.hpp
+++ b/3rdparty/libprocess/src/libevent.hpp
@@ -16,7 +16,6 @@
 #include <event2/event.h>
 
 #include <stout/lambda.hpp>
-#include <stout/thread_local.hpp>
 
 namespace process {
 
@@ -26,7 +25,7 @@ extern event_base* base;
 
 // Per thread bool pointer. We use a pointer to lazily construct the
 // actual bool.
-extern THREAD_LOCAL bool* _in_event_loop_;
+extern thread_local bool* _in_event_loop_;
 
 
 #define __in_event_loop__ *(_in_event_loop_ == nullptr ?                \

http://git-wip-us.apache.org/repos/asf/mesos/blob/305c5462/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index f5b666f..96ce7db 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -107,7 +107,6 @@
 #include <stout/stringify.hpp>
 #include <stout/strings.hpp>
 #include <stout/synchronized.hpp>
-#include <stout/thread_local.hpp>
 
 #include "authenticator_manager.hpp"
 #include "config.hpp"
@@ -617,11 +616,11 @@ PID<Help> help;
 // Global logging.
 PID<Logging> _logging;
 
-// Per thread process pointer.
-THREAD_LOCAL ProcessBase* __process__ = nullptr;
+// Per-thread process pointer.
+thread_local ProcessBase* __process__ = nullptr;
 
-// Per thread executor pointer.
-THREAD_LOCAL Executor* _executor_ = nullptr;
+// Per-thread executor pointer.
+thread_local Executor* _executor_ = nullptr;
 
 namespace metrics {
 namespace internal {


[2/5] mesos git commit: Updated "getting started" instructions for XCode 8.0 dependency.

Posted by ne...@apache.org.
Updated "getting started" instructions for XCode 8.0 dependency.

Review: https://reviews.apache.org/r/58311


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/242f58bc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/242f58bc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/242f58bc

Branch: refs/heads/master
Commit: 242f58bc19bf96b3ae9242ffaf99b49bc29ea852
Parents: 7e8b4e4
Author: Neil Conway <ne...@gmail.com>
Authored: Mon Apr 10 09:38:41 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Wed May 3 14:19:32 2017 -0700

----------------------------------------------------------------------
 docs/getting-started.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/242f58bc/docs/getting-started.md
----------------------------------------------------------------------
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 2578a29..85a959c 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -68,11 +68,11 @@ Following are the instructions for stock Ubuntu 16.04. If you are using a differ
     # Install other Mesos dependencies.
     $ sudo apt-get -y install build-essential python-dev python-virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven libapr1-dev libsvn-dev zlib1g-dev
 
-### Mac OS X 10.10 (Yosemite), Mac OS X 10.11 (El Capitan), macOS 10.12 (Sierra)
+### Mac OS X 10.11 (El Capitan), macOS 10.12 (Sierra)
 
-Following are the instructions for stock Mac OS X Yosemite and El Capitan. If you are using a different OS, please install the packages accordingly.
+Following are the instructions for Mac OS X El Capitan. When building Mesos with the Apple-provided toolchain, the Command Line Tools from XCode >= 8.0 are required; XCode 8 requires Mac OS X 10.11.5 or newer.
 
-    # Install Command Line Tools.
+    # Install Command Line Tools. The Command Line Tools from XCode >= 8.0 are required.
     $ xcode-select --install
 
     # Install Homebrew.


[5/5] mesos git commit: Removed `thread_local.hpp` from stout.

Posted by ne...@apache.org.
Removed `thread_local.hpp` from stout.

Review: https://reviews.apache.org/r/58314


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/310c0d62
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/310c0d62
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/310c0d62

Branch: refs/heads/master
Commit: 310c0d62d395fcc1a6063136832d5bda759e9919
Parents: 5cfab77
Author: Neil Conway <ne...@gmail.com>
Authored: Mon Apr 10 09:52:42 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Wed May 3 14:19:47 2017 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/Makefile.am            |  1 -
 3rdparty/stout/include/stout/thread_local.hpp | 18 ------------------
 2 files changed, 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/310c0d62/3rdparty/stout/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/Makefile.am b/3rdparty/stout/include/Makefile.am
index 04273ee..ea4341b 100644
--- a/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/stout/include/Makefile.am
@@ -194,7 +194,6 @@ nobase_include_HEADERS =			\
   stout/subcommand.hpp				\
   stout/svn.hpp					\
   stout/synchronized.hpp			\
-  stout/thread_local.hpp			\
   stout/try.hpp					\
   stout/tests/environment.hpp				\
   stout/tests/utils.hpp				\

http://git-wip-us.apache.org/repos/asf/mesos/blob/310c0d62/3rdparty/stout/include/stout/thread_local.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/thread_local.hpp b/3rdparty/stout/include/stout/thread_local.hpp
deleted file mode 100644
index dacf212..0000000
--- a/3rdparty/stout/include/stout/thread_local.hpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//  http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef __STOUT_THREAD_LOCAL_HPP__
-#define __STOUT_THREAD_LOCAL_HPP__
-
-#define THREAD_LOCAL thread_local
-
-#endif // __STOUT_THREAD_LOCAL_HPP__


[4/5] mesos git commit: Replaced `THREAD_LOCAL` with `thread_local` in stout.

Posted by ne...@apache.org.
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 <ne...@gmail.com>
Authored: Mon Apr 10 09:45:07 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
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;