move InlineExecutor, ManualExecutor, and GlobalThreadPoolList to
authorJames Sedgwick <jsedgwick@fb.com>
Sat, 21 Oct 2017 22:28:58 +0000 (15:28 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 21 Oct 2017 22:42:48 +0000 (15:42 -0700)
Summary:
That's everything that's going in executors/ except for Executor.h
itself, which is included in hphp so will have to wait

Reviewed By: mzlee

Differential Revision: D6100274

fbshipit-source-id: 6be37892b1ad7f46828acfa6b2951e51b157a86a

24 files changed:
folly/Makefile.am
folly/concurrency/GlobalThreadPoolList.cpp [deleted file]
folly/concurrency/GlobalThreadPoolList.h [deleted file]
folly/executors/GlobalExecutor.cpp
folly/executors/GlobalThreadPoolList.cpp [new file with mode: 0644]
folly/executors/GlobalThreadPoolList.h [new file with mode: 0644]
folly/executors/InlineExecutor.cpp [new file with mode: 0644]
folly/executors/InlineExecutor.h [new file with mode: 0644]
folly/executors/ManualExecutor.cpp [new file with mode: 0644]
folly/executors/ManualExecutor.h [new file with mode: 0644]
folly/executors/ThreadPoolExecutor.cpp
folly/executors/ThreadPoolExecutor.h
folly/executors/test/AsyncTest.cpp
folly/executors/test/SerialExecutorTest.cpp
folly/futures/Future-inl.h
folly/futures/InlineExecutor.cpp [deleted file]
folly/futures/InlineExecutor.h [deleted file]
folly/futures/ManualExecutor.cpp [deleted file]
folly/futures/ManualExecutor.h [deleted file]
folly/futures/test/Benchmark.cpp
folly/futures/test/ExecutorTest.cpp
folly/futures/test/SelfDestructTest.cpp
folly/futures/test/ViaTest.cpp
folly/futures/test/WindowTest.cpp

index cbc950b2f7081cf33eaf3ccb7a4ebcc6210849e5..eac08817882346a62ad80fa9ffd976da0dabd183 100644 (file)
@@ -59,7 +59,6 @@ nobase_follyinclude_HEADERS = \
        concurrency/CacheLocality.h \
        concurrency/ConcurrentHashMap.h \
        concurrency/CoreCachedSharedPtr.h \
        concurrency/CacheLocality.h \
        concurrency/ConcurrentHashMap.h \
        concurrency/CoreCachedSharedPtr.h \
-       concurrency/GlobalThreadPoolList.h \
        concurrency/detail/ConcurrentHashMap-detail.h \
        ConstexprMath.h \
        detail/AtomicHashUtils.h \
        concurrency/detail/ConcurrentHashMap-detail.h \
        ConstexprMath.h \
        detail/AtomicHashUtils.h \
@@ -92,6 +91,8 @@ nobase_follyinclude_HEADERS = \
        executors/FiberIOExecutor.h \
        executors/FutureExecutor.h \
        executors/GlobalExecutor.h \
        executors/FiberIOExecutor.h \
        executors/FutureExecutor.h \
        executors/GlobalExecutor.h \
+       executors/GlobalThreadPoolList.h \
+       executors/InlineExecutor.h \
        executors/IOExecutor.h \
        executors/IOObjectCache.h \
        executors/IOThreadPoolExecutor.h \
        executors/IOExecutor.h \
        executors/IOObjectCache.h \
        executors/IOThreadPoolExecutor.h \
@@ -216,8 +217,6 @@ nobase_follyinclude_HEADERS = \
        futures/Future-inl.h \
        futures/FutureException.h \
        futures/FutureSplitter.h \
        futures/Future-inl.h \
        futures/FutureException.h \
        futures/FutureSplitter.h \
-       futures/InlineExecutor.h \
-       futures/ManualExecutor.h \
        futures/Promise-inl.h \
        futures/Promise.h \
        futures/SharedPromise.h \
        futures/Promise-inl.h \
        futures/Promise.h \
        futures/SharedPromise.h \
@@ -491,7 +490,6 @@ libfolly_la_SOURCES = \
        compression/Compression.cpp \
        compression/Zlib.cpp \
        concurrency/CacheLocality.cpp \
        compression/Compression.cpp \
        compression/Zlib.cpp \
        concurrency/CacheLocality.cpp \
-       concurrency/GlobalThreadPoolList.cpp \
        detail/Futex.cpp \
        detail/IPAddress.cpp \
        detail/StaticSingletonManager.cpp \
        detail/Futex.cpp \
        detail/IPAddress.cpp \
        detail/StaticSingletonManager.cpp \
@@ -505,14 +503,15 @@ libfolly_la_SOURCES = \
        futures/Barrier.cpp \
        futures/Future.cpp \
        futures/FutureException.cpp \
        futures/Barrier.cpp \
        futures/Future.cpp \
        futures/FutureException.cpp \
-       futures/InlineExecutor.cpp \
-       futures/ManualExecutor.cpp \
        futures/ThreadWheelTimekeeper.cpp \
        futures/test/TestExecutor.cpp \
        executors/CPUThreadPoolExecutor.cpp \
        executors/Codel.cpp \
        executors/GlobalExecutor.cpp \
        futures/ThreadWheelTimekeeper.cpp \
        futures/test/TestExecutor.cpp \
        executors/CPUThreadPoolExecutor.cpp \
        executors/Codel.cpp \
        executors/GlobalExecutor.cpp \
+       executors/GlobalThreadPoolList.cpp \
        executors/IOThreadPoolExecutor.cpp \
        executors/IOThreadPoolExecutor.cpp \
+       executors/InlineExecutor.cpp \
+       executors/ManualExecutor.cpp \
        executors/SerialExecutor.cpp \
        executors/ThreadPoolExecutor.cpp \
        executors/ThreadedExecutor.cpp \
        executors/SerialExecutor.cpp \
        executors/ThreadPoolExecutor.cpp \
        executors/ThreadedExecutor.cpp \
diff --git a/folly/concurrency/GlobalThreadPoolList.cpp b/folly/concurrency/GlobalThreadPoolList.cpp
deleted file mode 100644 (file)
index 680193d..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright 2017 Facebook, Inc.
- *
- * 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.
- */
-
-#include <folly/concurrency/GlobalThreadPoolList.h>
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include <folly/CppAttributes.h>
-#include <folly/Indestructible.h>
-#include <folly/Synchronized.h>
-#include <folly/ThreadLocal.h>
-
-namespace folly {
-
-namespace {
-
-class ThreadListHook {
- public:
-  ThreadListHook(ThreadPoolListHook* poolId, std::thread::id threadId);
-  ~ThreadListHook();
-
- private:
-  ThreadListHook() {}
-  ThreadPoolListHook* poolId_;
-  std::thread::id threadId_;
-};
-
-class GlobalThreadPoolListImpl {
- public:
-  GlobalThreadPoolListImpl() {}
-
-  void registerThreadPool(ThreadPoolListHook* threadPoolId, std::string name);
-
-  void unregisterThreadPool(ThreadPoolListHook* threadPoolId);
-
-  void registerThreadPoolThread(
-      ThreadPoolListHook* threadPoolId,
-      std::thread::id threadId);
-
-  void unregisterThreadPoolThread(
-      ThreadPoolListHook* threadPoolId,
-      std::thread::id threadId);
-
- private:
-  struct PoolInfo {
-    ThreadPoolListHook* addr;
-    std::string name;
-    std::vector<std::thread::id> threads;
-  };
-
-  struct Pools {
-    // Just a vector since ease of access from gdb is the most important
-    // property
-    std::vector<PoolInfo> poolsInfo_;
-
-    std::vector<std::thread::id>* FOLLY_NULLABLE
-    getThreadVector(void* threadPoolId) {
-      for (auto& elem : vector()) {
-        if (elem.addr == threadPoolId) {
-          return &elem.threads;
-        }
-      }
-
-      return nullptr;
-    }
-
-    std::vector<PoolInfo>& vector() {
-      return poolsInfo_;
-    }
-  };
-
-  Pools pools_;
-};
-
-class GlobalThreadPoolList {
- public:
-  GlobalThreadPoolList() {}
-
-  static GlobalThreadPoolList& instance();
-
-  void registerThreadPool(ThreadPoolListHook* threadPoolId, std::string name);
-
-  void unregisterThreadPool(ThreadPoolListHook* threadPoolId);
-
-  void registerThreadPoolThread(
-      ThreadPoolListHook* threadPoolId,
-      std::thread::id threadId);
-
-  void unregisterThreadPoolThread(
-      ThreadPoolListHook* threadPoolId,
-      std::thread::id threadId);
-
-  GlobalThreadPoolList(GlobalThreadPoolList const&) = delete;
-  void operator=(GlobalThreadPoolList const&) = delete;
-
- private:
-  folly::Synchronized<GlobalThreadPoolListImpl> globalListImpl_;
-  folly::ThreadLocalPtr<ThreadListHook> threadHook_;
-};
-
-} // namespace
-
-GlobalThreadPoolList& GlobalThreadPoolList::instance() {
-  static folly::Indestructible<GlobalThreadPoolList> ret;
-  return *ret;
-}
-
-void GlobalThreadPoolList::registerThreadPool(
-    ThreadPoolListHook* threadPoolId,
-    std::string name) {
-  globalListImpl_->registerThreadPool(threadPoolId, name);
-}
-
-void GlobalThreadPoolList::unregisterThreadPool(
-    ThreadPoolListHook* threadPoolId) {
-  globalListImpl_->unregisterThreadPool(threadPoolId);
-}
-
-void GlobalThreadPoolList::registerThreadPoolThread(
-    ThreadPoolListHook* threadPoolId,
-    std::thread::id threadId) {
-  DCHECK(!threadHook_);
-  threadHook_.reset(make_unique<ThreadListHook>(threadPoolId, threadId));
-
-  globalListImpl_->registerThreadPoolThread(threadPoolId, threadId);
-}
-
-void GlobalThreadPoolList::unregisterThreadPoolThread(
-    ThreadPoolListHook* threadPoolId,
-    std::thread::id threadId) {
-  (void)threadPoolId;
-  (void)threadId;
-  globalListImpl_->unregisterThreadPoolThread(threadPoolId, threadId);
-}
-
-void GlobalThreadPoolListImpl::registerThreadPool(
-    ThreadPoolListHook* threadPoolId,
-    std::string name) {
-  PoolInfo info;
-  info.name = name;
-  info.addr = threadPoolId;
-  pools_.vector().push_back(info);
-}
-
-void GlobalThreadPoolListImpl::unregisterThreadPool(
-    ThreadPoolListHook* threadPoolId) {
-  auto& vector = pools_.vector();
-  vector.erase(
-      std::remove_if(
-          vector.begin(),
-          vector.end(),
-          [=](PoolInfo& i) { return i.addr == threadPoolId; }),
-      vector.end());
-}
-
-void GlobalThreadPoolListImpl::registerThreadPoolThread(
-    ThreadPoolListHook* threadPoolId,
-    std::thread::id threadId) {
-  auto vec = pools_.getThreadVector(threadPoolId);
-  if (vec == nullptr) {
-    return;
-  }
-
-  vec->push_back(threadId);
-}
-
-void GlobalThreadPoolListImpl::unregisterThreadPoolThread(
-    ThreadPoolListHook* threadPoolId,
-    std::thread::id threadId) {
-  auto vec = pools_.getThreadVector(threadPoolId);
-  if (vec == nullptr) {
-    return;
-  }
-
-  vec->erase(std::remove(vec->begin(), vec->end(), threadId), vec->end());
-}
-
-ThreadListHook::ThreadListHook(
-    ThreadPoolListHook* poolId,
-    std::thread::id threadId) {
-  poolId_ = poolId;
-  threadId_ = threadId;
-}
-
-ThreadListHook::~ThreadListHook() {
-  GlobalThreadPoolList::instance().unregisterThreadPoolThread(
-      poolId_, threadId_);
-}
-
-ThreadPoolListHook::ThreadPoolListHook(std::string name) {
-  GlobalThreadPoolList::instance().registerThreadPool(this, name);
-}
-
-ThreadPoolListHook::~ThreadPoolListHook() {
-  GlobalThreadPoolList::instance().unregisterThreadPool(this);
-}
-
-void ThreadPoolListHook::registerThread() {
-  GlobalThreadPoolList::instance().registerThreadPoolThread(
-      this, std::this_thread::get_id());
-}
-
-} // folly
diff --git a/folly/concurrency/GlobalThreadPoolList.h b/folly/concurrency/GlobalThreadPoolList.h
deleted file mode 100644 (file)
index 8e13df0..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2017 Facebook, Inc.
- *
- * 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.
- */
-
-#pragma once
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include <folly/Indestructible.h>
-#include <folly/Synchronized.h>
-#include <folly/ThreadLocal.h>
-
-namespace folly {
-
-/**
- * A hook for tracking which threads belong to which thread pools.
- * This is used only by a gdb extension to aid in debugging. You won't be able
- * to see any useful information from within C++ code.
- *
- * An instance of ThreadPoolListHook should be created in the thread pool class
- * that you want to keep track of. Then, to register a thread you call
- * registerThread() on your instance of ThreadPoolListHook from that thread.
- *
- * When a thread exits it will be removed from the list
- * When the thread pool is destroyed, it will be removed from the list
- */
-class ThreadPoolListHook {
- public:
-  /**
-   * Name is used to identify the thread pool when listing threads.
-   */
-  explicit ThreadPoolListHook(std::string name);
-  ~ThreadPoolListHook();
-
-  /**
-   * Call this from any new thread that the thread pool creates.
-   */
-  void registerThread();
-
-  ThreadPoolListHook(const ThreadPoolListHook& other) = delete;
-  ThreadPoolListHook& operator=(const ThreadPoolListHook&) = delete;
-
- private:
-  ThreadPoolListHook();
-};
-
-} // folly
index d2de51d7530d775f2c7c3ff868be1daf26493dbf..ef85375171ff5f4f65be06b3192ae835f7a809b4 100644 (file)
@@ -17,7 +17,7 @@
 #include <folly/Singleton.h>
 #include <folly/executors/IOExecutor.h>
 #include <folly/executors/IOThreadPoolExecutor.h>
 #include <folly/Singleton.h>
 #include <folly/executors/IOExecutor.h>
 #include <folly/executors/IOThreadPoolExecutor.h>
-#include <folly/futures/InlineExecutor.h>
+#include <folly/executors/InlineExecutor.h>
 
 using namespace folly;
 
 
 using namespace folly;
 
diff --git a/folly/executors/GlobalThreadPoolList.cpp b/folly/executors/GlobalThreadPoolList.cpp
new file mode 100644 (file)
index 0000000..a9e5e53
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * Copyright 2017 Facebook, Inc.
+ *
+ * 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.
+ */
+
+#include <folly/executors/GlobalThreadPoolList.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <folly/CppAttributes.h>
+#include <folly/Indestructible.h>
+#include <folly/Synchronized.h>
+#include <folly/ThreadLocal.h>
+
+namespace folly {
+
+namespace {
+
+class ThreadListHook {
+ public:
+  ThreadListHook(ThreadPoolListHook* poolId, std::thread::id threadId);
+  ~ThreadListHook();
+
+ private:
+  ThreadListHook() {}
+  ThreadPoolListHook* poolId_;
+  std::thread::id threadId_;
+};
+
+class GlobalThreadPoolListImpl {
+ public:
+  GlobalThreadPoolListImpl() {}
+
+  void registerThreadPool(ThreadPoolListHook* threadPoolId, std::string name);
+
+  void unregisterThreadPool(ThreadPoolListHook* threadPoolId);
+
+  void registerThreadPoolThread(
+      ThreadPoolListHook* threadPoolId,
+      std::thread::id threadId);
+
+  void unregisterThreadPoolThread(
+      ThreadPoolListHook* threadPoolId,
+      std::thread::id threadId);
+
+ private:
+  struct PoolInfo {
+    ThreadPoolListHook* addr;
+    std::string name;
+    std::vector<std::thread::id> threads;
+  };
+
+  struct Pools {
+    // Just a vector since ease of access from gdb is the most important
+    // property
+    std::vector<PoolInfo> poolsInfo_;
+
+    std::vector<std::thread::id>* FOLLY_NULLABLE
+    getThreadVector(void* threadPoolId) {
+      for (auto& elem : vector()) {
+        if (elem.addr == threadPoolId) {
+          return &elem.threads;
+        }
+      }
+
+      return nullptr;
+    }
+
+    std::vector<PoolInfo>& vector() {
+      return poolsInfo_;
+    }
+  };
+
+  Pools pools_;
+};
+
+class GlobalThreadPoolList {
+ public:
+  GlobalThreadPoolList() {}
+
+  static GlobalThreadPoolList& instance();
+
+  void registerThreadPool(ThreadPoolListHook* threadPoolId, std::string name);
+
+  void unregisterThreadPool(ThreadPoolListHook* threadPoolId);
+
+  void registerThreadPoolThread(
+      ThreadPoolListHook* threadPoolId,
+      std::thread::id threadId);
+
+  void unregisterThreadPoolThread(
+      ThreadPoolListHook* threadPoolId,
+      std::thread::id threadId);
+
+  GlobalThreadPoolList(GlobalThreadPoolList const&) = delete;
+  void operator=(GlobalThreadPoolList const&) = delete;
+
+ private:
+  folly::Synchronized<GlobalThreadPoolListImpl> globalListImpl_;
+  folly::ThreadLocalPtr<ThreadListHook> threadHook_;
+};
+
+} // namespace
+
+GlobalThreadPoolList& GlobalThreadPoolList::instance() {
+  static folly::Indestructible<GlobalThreadPoolList> ret;
+  return *ret;
+}
+
+void GlobalThreadPoolList::registerThreadPool(
+    ThreadPoolListHook* threadPoolId,
+    std::string name) {
+  globalListImpl_->registerThreadPool(threadPoolId, name);
+}
+
+void GlobalThreadPoolList::unregisterThreadPool(
+    ThreadPoolListHook* threadPoolId) {
+  globalListImpl_->unregisterThreadPool(threadPoolId);
+}
+
+void GlobalThreadPoolList::registerThreadPoolThread(
+    ThreadPoolListHook* threadPoolId,
+    std::thread::id threadId) {
+  DCHECK(!threadHook_);
+  threadHook_.reset(make_unique<ThreadListHook>(threadPoolId, threadId));
+
+  globalListImpl_->registerThreadPoolThread(threadPoolId, threadId);
+}
+
+void GlobalThreadPoolList::unregisterThreadPoolThread(
+    ThreadPoolListHook* threadPoolId,
+    std::thread::id threadId) {
+  (void)threadPoolId;
+  (void)threadId;
+  globalListImpl_->unregisterThreadPoolThread(threadPoolId, threadId);
+}
+
+void GlobalThreadPoolListImpl::registerThreadPool(
+    ThreadPoolListHook* threadPoolId,
+    std::string name) {
+  PoolInfo info;
+  info.name = name;
+  info.addr = threadPoolId;
+  pools_.vector().push_back(info);
+}
+
+void GlobalThreadPoolListImpl::unregisterThreadPool(
+    ThreadPoolListHook* threadPoolId) {
+  auto& vector = pools_.vector();
+  vector.erase(
+      std::remove_if(
+          vector.begin(),
+          vector.end(),
+          [=](PoolInfo& i) { return i.addr == threadPoolId; }),
+      vector.end());
+}
+
+void GlobalThreadPoolListImpl::registerThreadPoolThread(
+    ThreadPoolListHook* threadPoolId,
+    std::thread::id threadId) {
+  auto vec = pools_.getThreadVector(threadPoolId);
+  if (vec == nullptr) {
+    return;
+  }
+
+  vec->push_back(threadId);
+}
+
+void GlobalThreadPoolListImpl::unregisterThreadPoolThread(
+    ThreadPoolListHook* threadPoolId,
+    std::thread::id threadId) {
+  auto vec = pools_.getThreadVector(threadPoolId);
+  if (vec == nullptr) {
+    return;
+  }
+
+  vec->erase(std::remove(vec->begin(), vec->end(), threadId), vec->end());
+}
+
+ThreadListHook::ThreadListHook(
+    ThreadPoolListHook* poolId,
+    std::thread::id threadId) {
+  poolId_ = poolId;
+  threadId_ = threadId;
+}
+
+ThreadListHook::~ThreadListHook() {
+  GlobalThreadPoolList::instance().unregisterThreadPoolThread(
+      poolId_, threadId_);
+}
+
+ThreadPoolListHook::ThreadPoolListHook(std::string name) {
+  GlobalThreadPoolList::instance().registerThreadPool(this, name);
+}
+
+ThreadPoolListHook::~ThreadPoolListHook() {
+  GlobalThreadPoolList::instance().unregisterThreadPool(this);
+}
+
+void ThreadPoolListHook::registerThread() {
+  GlobalThreadPoolList::instance().registerThreadPoolThread(
+      this, std::this_thread::get_id());
+}
+
+} // folly
diff --git a/folly/executors/GlobalThreadPoolList.h b/folly/executors/GlobalThreadPoolList.h
new file mode 100644 (file)
index 0000000..8e13df0
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2017 Facebook, Inc.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <folly/Indestructible.h>
+#include <folly/Synchronized.h>
+#include <folly/ThreadLocal.h>
+
+namespace folly {
+
+/**
+ * A hook for tracking which threads belong to which thread pools.
+ * This is used only by a gdb extension to aid in debugging. You won't be able
+ * to see any useful information from within C++ code.
+ *
+ * An instance of ThreadPoolListHook should be created in the thread pool class
+ * that you want to keep track of. Then, to register a thread you call
+ * registerThread() on your instance of ThreadPoolListHook from that thread.
+ *
+ * When a thread exits it will be removed from the list
+ * When the thread pool is destroyed, it will be removed from the list
+ */
+class ThreadPoolListHook {
+ public:
+  /**
+   * Name is used to identify the thread pool when listing threads.
+   */
+  explicit ThreadPoolListHook(std::string name);
+  ~ThreadPoolListHook();
+
+  /**
+   * Call this from any new thread that the thread pool creates.
+   */
+  void registerThread();
+
+  ThreadPoolListHook(const ThreadPoolListHook& other) = delete;
+  ThreadPoolListHook& operator=(const ThreadPoolListHook&) = delete;
+
+ private:
+  ThreadPoolListHook();
+};
+
+} // folly
diff --git a/folly/executors/InlineExecutor.cpp b/folly/executors/InlineExecutor.cpp
new file mode 100644 (file)
index 0000000..d51ae7b
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2017 Facebook, Inc.
+ *
+ * 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.
+ */
+
+#include <folly/executors/InlineExecutor.h>
+
+#include <folly/Indestructible.h>
+
+namespace folly {
+
+InlineExecutor& InlineExecutor::instance() {
+  static auto instance = Indestructible<InlineExecutor>{};
+  return *instance;
+}
+
+} // namespace folly
diff --git a/folly/executors/InlineExecutor.h b/folly/executors/InlineExecutor.h
new file mode 100644 (file)
index 0000000..644ff7b
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 Facebook, Inc.
+ *
+ * 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.
+ */
+
+#pragma once
+#include <folly/Executor.h>
+
+namespace folly {
+
+/// When work is "queued", execute it immediately inline.
+/// Usually when you think you want this, you actually want a
+/// QueuedImmediateExecutor.
+class InlineExecutor : public Executor {
+ public:
+  static InlineExecutor& instance();
+
+  void add(Func f) override {
+    f();
+  }
+};
+
+} // namespace folly
diff --git a/folly/executors/ManualExecutor.cpp b/folly/executors/ManualExecutor.cpp
new file mode 100644 (file)
index 0000000..51ff9c8
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2017 Facebook, Inc.
+ *
+ * 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.
+ */
+
+#include <folly/executors/ManualExecutor.h>
+
+#include <string.h>
+#include <string>
+#include <tuple>
+
+namespace folly {
+
+void ManualExecutor::add(Func callback) {
+  std::lock_guard<std::mutex> lock(lock_);
+  funcs_.emplace(std::move(callback));
+  sem_.post();
+}
+
+size_t ManualExecutor::run() {
+  size_t count;
+  size_t n;
+  Func func;
+
+  {
+    std::lock_guard<std::mutex> lock(lock_);
+
+    while (!scheduledFuncs_.empty()) {
+      auto& sf = scheduledFuncs_.top();
+      if (sf.time > now_) {
+        break;
+      }
+      funcs_.emplace(sf.moveOutFunc());
+      scheduledFuncs_.pop();
+    }
+
+    n = funcs_.size();
+  }
+
+  for (count = 0; count < n; count++) {
+    {
+      std::lock_guard<std::mutex> lock(lock_);
+      if (funcs_.empty()) {
+        break;
+      }
+
+      // Balance the semaphore so it doesn't grow without bound
+      // if nobody is calling wait().
+      // This may fail (with EAGAIN), that's fine.
+      sem_.tryWait();
+
+      func = std::move(funcs_.front());
+      funcs_.pop();
+    }
+    func();
+  }
+
+  return count;
+}
+
+void ManualExecutor::wait() {
+  while (true) {
+    {
+      std::lock_guard<std::mutex> lock(lock_);
+      if (!funcs_.empty()) {
+        break;
+      }
+    }
+
+    sem_.wait();
+  }
+}
+
+void ManualExecutor::advanceTo(TimePoint const& t) {
+  if (t > now_) {
+    now_ = t;
+  }
+  run();
+}
+
+} // namespace folly
diff --git a/folly/executors/ManualExecutor.h b/folly/executors/ManualExecutor.h
new file mode 100644 (file)
index 0000000..028a4ce
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2017 Facebook, Inc.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <cstdio>
+#include <memory>
+#include <mutex>
+#include <queue>
+
+#include <folly/LifoSem.h>
+#include <folly/executors/DrivableExecutor.h>
+#include <folly/executors/ScheduledExecutor.h>
+
+namespace folly {
+  /// A ManualExecutor only does work when you turn the crank, by calling
+  /// run() or indirectly with makeProgress() or waitFor().
+  ///
+  /// The clock for a manual executor starts at 0 and advances only when you
+  /// ask it to. i.e. time is also under manual control.
+  ///
+  /// NB No attempt has been made to make anything other than add and schedule
+  /// threadsafe.
+  class ManualExecutor : public DrivableExecutor,
+                         public ScheduledExecutor {
+   public:
+    void add(Func) override;
+
+    /// Do work. Returns the number of functions that were executed (maybe 0).
+    /// Non-blocking, in the sense that we don't wait for work (we can't
+    /// control whether one of the functions blocks).
+    /// This is stable, it will not chase an ever-increasing tail of work.
+    /// This also means, there may be more work available to perform at the
+    /// moment that this returns.
+    size_t run();
+
+    /// Wait for work to do.
+    void wait();
+
+    /// Wait for work to do, and do it.
+    void makeProgress() {
+      wait();
+      run();
+    }
+
+    /// Implements DrivableExecutor
+    void drive() override {
+      makeProgress();
+    }
+
+    /// makeProgress until this Future is ready.
+    template <class F> void waitFor(F const& f) {
+      // TODO(5427828)
+#if 0
+      while (!f.isReady())
+        makeProgress();
+#else
+      while (!f.isReady()) {
+        run();
+      }
+#endif
+
+    }
+
+    void scheduleAt(Func&& f, TimePoint const& t) override {
+      std::lock_guard<std::mutex> lock(lock_);
+      scheduledFuncs_.emplace(t, std::move(f));
+      sem_.post();
+    }
+
+    /// Advance the clock. The clock never advances on its own.
+    /// Advancing the clock causes some work to be done, if work is available
+    /// to do (perhaps newly available because of the advanced clock).
+    /// If dur is <= 0 this is a noop.
+    void advance(Duration const& dur) {
+      advanceTo(now_ + dur);
+    }
+
+    /// Advance the clock to this absolute time. If t is <= now(),
+    /// this is a noop.
+    void advanceTo(TimePoint const& t);
+
+    TimePoint now() override { return now_; }
+
+    /// Flush the function queue. Destroys all stored functions without
+    /// executing them. Returns number of removed functions.
+    std::size_t clear() {
+      std::queue<Func> funcs;
+      std::priority_queue<ScheduledFunc> scheduled_funcs;
+
+      {
+        std::lock_guard<std::mutex> lock(lock_);
+        funcs_.swap(funcs);
+        scheduledFuncs_.swap(scheduled_funcs);
+      }
+
+      return funcs.size() + scheduled_funcs.size();
+    }
+
+   private:
+    std::mutex lock_;
+    std::queue<Func> funcs_;
+    LifoSem sem_;
+
+    // helper class to enable ordering of scheduled events in the priority
+    // queue
+    struct ScheduledFunc {
+      TimePoint time;
+      size_t ordinal;
+      Func mutable func;
+
+      ScheduledFunc(TimePoint const& t, Func&& f)
+        : time(t), func(std::move(f))
+      {
+        static size_t seq = 0;
+        ordinal = seq++;
+      }
+
+      bool operator<(ScheduledFunc const& b) const {
+        // Earlier-scheduled things must be *higher* priority
+        // in the max-based std::priority_queue
+        if (time == b.time) {
+          return ordinal > b.ordinal;
+        }
+        return time > b.time;
+      }
+
+      Func&& moveOutFunc() const {
+        return std::move(func);
+      }
+    };
+    std::priority_queue<ScheduledFunc> scheduledFuncs_;
+    TimePoint now_ = TimePoint::min();
+  };
+
+}
index 227f2b1da544ff0ef3b7da1e48856eeb202fdd82..84394db0059bd396cb2f68387a5a929c2d2685b9 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <folly/executors/ThreadPoolExecutor.h>
 
 
 #include <folly/executors/ThreadPoolExecutor.h>
 
-#include <folly/concurrency/GlobalThreadPoolList.h>
+#include <folly/executors/GlobalThreadPoolList.h>
 
 namespace folly {
 
 
 namespace folly {
 
index 09ff14fd02feb3c57130f7d0e83f750415eba9f2..a92726ef51c0e0451f5d0fa68b8c448bee9d31ec 100644 (file)
@@ -19,7 +19,7 @@
 #include <folly/Executor.h>
 #include <folly/Memory.h>
 #include <folly/RWSpinLock.h>
 #include <folly/Executor.h>
 #include <folly/Memory.h>
 #include <folly/RWSpinLock.h>
-#include <folly/concurrency/GlobalThreadPoolList.h>
+#include <folly/executors/GlobalThreadPoolList.h>
 #include <folly/executors/task_queue/LifoSemMPMCQueue.h>
 #include <folly/executors/thread_factory/NamedThreadFactory.h>
 #include <folly/io/async/Request.h>
 #include <folly/executors/task_queue/LifoSemMPMCQueue.h>
 #include <folly/executors/thread_factory/NamedThreadFactory.h>
 #include <folly/io/async/Request.h>
index 0622a8a6184b281ae14b5b85901606967cfe2d82..4a7f0cf007979b0436eff22f5ba15ce0166cf4db 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <folly/executors/Async.h>
  */
 
 #include <folly/executors/Async.h>
-#include <folly/futures/ManualExecutor.h>
+#include <folly/executors/ManualExecutor.h>
 #include <folly/portability/GTest.h>
 
 using namespace folly;
 #include <folly/portability/GTest.h>
 
 using namespace folly;
index 285fd74736b825134209743677f22ece4e28dd85..ae487591f860c80ee5d6275ec789535ba7c590ff 100644 (file)
@@ -18,8 +18,8 @@
 
 #include <folly/Baton.h>
 #include <folly/executors/CPUThreadPoolExecutor.h>
 
 #include <folly/Baton.h>
 #include <folly/executors/CPUThreadPoolExecutor.h>
+#include <folly/executors/InlineExecutor.h>
 #include <folly/executors/SerialExecutor.h>
 #include <folly/executors/SerialExecutor.h>
-#include <folly/futures/InlineExecutor.h>
 #include <folly/portability/GTest.h>
 
 using namespace std::chrono;
 #include <folly/portability/GTest.h>
 
 using namespace std::chrono;
index c7ddeb0a80e609559cd202575c878ecbbd218f4a..b903a644644640124d0685495c7a43df46d8b45c 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <folly/Baton.h>
 #include <folly/Optional.h>
 
 #include <folly/Baton.h>
 #include <folly/Optional.h>
-#include <folly/futures/InlineExecutor.h>
+#include <folly/executors/InlineExecutor.h>
 #include <folly/futures/Timekeeper.h>
 #include <folly/futures/detail/Core.h>
 
 #include <folly/futures/Timekeeper.h>
 #include <folly/futures/detail/Core.h>
 
diff --git a/folly/futures/InlineExecutor.cpp b/folly/futures/InlineExecutor.cpp
deleted file mode 100644 (file)
index 848e7f2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017 Facebook, Inc.
- *
- * 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.
- */
-
-#include <folly/futures/InlineExecutor.h>
-
-#include <folly/Indestructible.h>
-
-namespace folly {
-
-InlineExecutor& InlineExecutor::instance() {
-  static auto instance = Indestructible<InlineExecutor>{};
-  return *instance;
-}
-
-} // namespace folly
diff --git a/folly/futures/InlineExecutor.h b/folly/futures/InlineExecutor.h
deleted file mode 100644 (file)
index 644ff7b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017 Facebook, Inc.
- *
- * 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.
- */
-
-#pragma once
-#include <folly/Executor.h>
-
-namespace folly {
-
-/// When work is "queued", execute it immediately inline.
-/// Usually when you think you want this, you actually want a
-/// QueuedImmediateExecutor.
-class InlineExecutor : public Executor {
- public:
-  static InlineExecutor& instance();
-
-  void add(Func f) override {
-    f();
-  }
-};
-
-} // namespace folly
diff --git a/folly/futures/ManualExecutor.cpp b/folly/futures/ManualExecutor.cpp
deleted file mode 100644 (file)
index 50941d0..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017 Facebook, Inc.
- *
- * 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.
- */
-
-#include <folly/futures/ManualExecutor.h>
-
-#include <string.h>
-#include <string>
-#include <tuple>
-
-namespace folly {
-
-void ManualExecutor::add(Func callback) {
-  std::lock_guard<std::mutex> lock(lock_);
-  funcs_.emplace(std::move(callback));
-  sem_.post();
-}
-
-size_t ManualExecutor::run() {
-  size_t count;
-  size_t n;
-  Func func;
-
-  {
-    std::lock_guard<std::mutex> lock(lock_);
-
-    while (!scheduledFuncs_.empty()) {
-      auto& sf = scheduledFuncs_.top();
-      if (sf.time > now_) {
-        break;
-      }
-      funcs_.emplace(sf.moveOutFunc());
-      scheduledFuncs_.pop();
-    }
-
-    n = funcs_.size();
-  }
-
-  for (count = 0; count < n; count++) {
-    {
-      std::lock_guard<std::mutex> lock(lock_);
-      if (funcs_.empty()) {
-        break;
-      }
-
-      // Balance the semaphore so it doesn't grow without bound
-      // if nobody is calling wait().
-      // This may fail (with EAGAIN), that's fine.
-      sem_.tryWait();
-
-      func = std::move(funcs_.front());
-      funcs_.pop();
-    }
-    func();
-  }
-
-  return count;
-}
-
-void ManualExecutor::wait() {
-  while (true) {
-    {
-      std::lock_guard<std::mutex> lock(lock_);
-      if (!funcs_.empty()) {
-        break;
-      }
-    }
-
-    sem_.wait();
-  }
-}
-
-void ManualExecutor::advanceTo(TimePoint const& t) {
-  if (t > now_) {
-    now_ = t;
-  }
-  run();
-}
-
-} // namespace folly
diff --git a/folly/futures/ManualExecutor.h b/folly/futures/ManualExecutor.h
deleted file mode 100644 (file)
index 028a4ce..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2017 Facebook, Inc.
- *
- * 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.
- */
-
-#pragma once
-
-#include <cstdio>
-#include <memory>
-#include <mutex>
-#include <queue>
-
-#include <folly/LifoSem.h>
-#include <folly/executors/DrivableExecutor.h>
-#include <folly/executors/ScheduledExecutor.h>
-
-namespace folly {
-  /// A ManualExecutor only does work when you turn the crank, by calling
-  /// run() or indirectly with makeProgress() or waitFor().
-  ///
-  /// The clock for a manual executor starts at 0 and advances only when you
-  /// ask it to. i.e. time is also under manual control.
-  ///
-  /// NB No attempt has been made to make anything other than add and schedule
-  /// threadsafe.
-  class ManualExecutor : public DrivableExecutor,
-                         public ScheduledExecutor {
-   public:
-    void add(Func) override;
-
-    /// Do work. Returns the number of functions that were executed (maybe 0).
-    /// Non-blocking, in the sense that we don't wait for work (we can't
-    /// control whether one of the functions blocks).
-    /// This is stable, it will not chase an ever-increasing tail of work.
-    /// This also means, there may be more work available to perform at the
-    /// moment that this returns.
-    size_t run();
-
-    /// Wait for work to do.
-    void wait();
-
-    /// Wait for work to do, and do it.
-    void makeProgress() {
-      wait();
-      run();
-    }
-
-    /// Implements DrivableExecutor
-    void drive() override {
-      makeProgress();
-    }
-
-    /// makeProgress until this Future is ready.
-    template <class F> void waitFor(F const& f) {
-      // TODO(5427828)
-#if 0
-      while (!f.isReady())
-        makeProgress();
-#else
-      while (!f.isReady()) {
-        run();
-      }
-#endif
-
-    }
-
-    void scheduleAt(Func&& f, TimePoint const& t) override {
-      std::lock_guard<std::mutex> lock(lock_);
-      scheduledFuncs_.emplace(t, std::move(f));
-      sem_.post();
-    }
-
-    /// Advance the clock. The clock never advances on its own.
-    /// Advancing the clock causes some work to be done, if work is available
-    /// to do (perhaps newly available because of the advanced clock).
-    /// If dur is <= 0 this is a noop.
-    void advance(Duration const& dur) {
-      advanceTo(now_ + dur);
-    }
-
-    /// Advance the clock to this absolute time. If t is <= now(),
-    /// this is a noop.
-    void advanceTo(TimePoint const& t);
-
-    TimePoint now() override { return now_; }
-
-    /// Flush the function queue. Destroys all stored functions without
-    /// executing them. Returns number of removed functions.
-    std::size_t clear() {
-      std::queue<Func> funcs;
-      std::priority_queue<ScheduledFunc> scheduled_funcs;
-
-      {
-        std::lock_guard<std::mutex> lock(lock_);
-        funcs_.swap(funcs);
-        scheduledFuncs_.swap(scheduled_funcs);
-      }
-
-      return funcs.size() + scheduled_funcs.size();
-    }
-
-   private:
-    std::mutex lock_;
-    std::queue<Func> funcs_;
-    LifoSem sem_;
-
-    // helper class to enable ordering of scheduled events in the priority
-    // queue
-    struct ScheduledFunc {
-      TimePoint time;
-      size_t ordinal;
-      Func mutable func;
-
-      ScheduledFunc(TimePoint const& t, Func&& f)
-        : time(t), func(std::move(f))
-      {
-        static size_t seq = 0;
-        ordinal = seq++;
-      }
-
-      bool operator<(ScheduledFunc const& b) const {
-        // Earlier-scheduled things must be *higher* priority
-        // in the max-based std::priority_queue
-        if (time == b.time) {
-          return ordinal > b.ordinal;
-        }
-        return time > b.time;
-      }
-
-      Func&& moveOutFunc() const {
-        return std::move(func);
-      }
-    };
-    std::priority_queue<ScheduledFunc> scheduledFuncs_;
-    TimePoint now_ = TimePoint::min();
-  };
-
-}
index 56f4f712375ade70afd76525b80eeebe6247bb0f..a9c743de70a4f089994718e876563a1b731f426e 100644 (file)
@@ -16,8 +16,8 @@
 
 #include <folly/Benchmark.h>
 #include <folly/Baton.h>
 
 #include <folly/Benchmark.h>
 #include <folly/Baton.h>
+#include <folly/executors/InlineExecutor.h>
 #include <folly/futures/Future.h>
 #include <folly/futures/Future.h>
-#include <folly/futures/InlineExecutor.h>
 #include <folly/futures/Promise.h>
 #include <folly/portability/GFlags.h>
 #include <folly/portability/Semaphore.h>
 #include <folly/futures/Promise.h>
 #include <folly/portability/GFlags.h>
 #include <folly/portability/Semaphore.h>
index 2c201d0a9882c7547dddc866f9097abc4859df7c..1755a2fc9e210fdcb37a50291b33de6b83c6c38a 100644 (file)
  */
 
 #include <folly/Baton.h>
  */
 
 #include <folly/Baton.h>
+#include <folly/executors/InlineExecutor.h>
+#include <folly/executors/ManualExecutor.h>
 #include <folly/executors/QueuedImmediateExecutor.h>
 #include <folly/futures/Future.h>
 #include <folly/executors/QueuedImmediateExecutor.h>
 #include <folly/futures/Future.h>
-#include <folly/futures/InlineExecutor.h>
-#include <folly/futures/ManualExecutor.h>
 #include <folly/portability/GTest.h>
 
 // TODO(jsedgwick) move this test to executors/test/ once the tested executors
 #include <folly/portability/GTest.h>
 
 // TODO(jsedgwick) move this test to executors/test/ once the tested executors
index 41b56bf5967d84bf4f5bbe20f0c024c170d23b55..fb2bc3f2011b976cd2635898c35a40fb33cb699f 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
  * limitations under the License.
  */
 
+#include <folly/executors/InlineExecutor.h>
 #include <folly/futures/Future.h>
 #include <folly/futures/Future.h>
-#include <folly/futures/InlineExecutor.h>
 #include <folly/portability/GTest.h>
 
 using namespace folly;
 #include <folly/portability/GTest.h>
 
 using namespace folly;
index 79e6c9bf9847d5a3a9a6e82c7697cb6e20d75955..fb2008a8d0236f65472af5f78849eedf31328aae 100644 (file)
@@ -19,9 +19,9 @@
 #include <folly/Baton.h>
 #include <folly/MPMCQueue.h>
 #include <folly/executors/DrivableExecutor.h>
 #include <folly/Baton.h>
 #include <folly/MPMCQueue.h>
 #include <folly/executors/DrivableExecutor.h>
+#include <folly/executors/InlineExecutor.h>
+#include <folly/executors/ManualExecutor.h>
 #include <folly/futures/Future.h>
 #include <folly/futures/Future.h>
-#include <folly/futures/InlineExecutor.h>
-#include <folly/futures/ManualExecutor.h>
 #include <folly/portability/GTest.h>
 
 using namespace folly;
 #include <folly/portability/GTest.h>
 
 using namespace folly;
index 098fc7a8fef9a7e02eb41569b4d18b8802346d84..90158d4749ce36e1968e664346c38e4e9fc8cf48 100644 (file)
@@ -17,8 +17,8 @@
 #include <boost/thread/barrier.hpp>
 
 #include <folly/Conv.h>
 #include <boost/thread/barrier.hpp>
 
 #include <folly/Conv.h>
+#include <folly/executors/ManualExecutor.h>
 #include <folly/futures/Future.h>
 #include <folly/futures/Future.h>
-#include <folly/futures/ManualExecutor.h>
 #include <folly/portability/GTest.h>
 
 #include <vector>
 #include <folly/portability/GTest.h>
 
 #include <vector>