Future<Unit> wangle fixup
[folly.git] / folly / wangle / concurrent / IOThreadPoolExecutor.h
index f3c5865f36c8eb70b8d2e5f8a27e7066d6d4f9bf..b298ccae9000814f152f1b830f0718ae3cacc5db 100644 (file)
@@ -16,7 +16,7 @@
 
 #pragma once
 
-#include <folly/io/async/EventBase.h>
+#include <folly/io/async/EventBaseManager.h>
 #include <folly/wangle/concurrent/IOExecutor.h>
 #include <folly/wangle/concurrent/ThreadPoolExecutor.h>
 
@@ -29,7 +29,8 @@ class IOThreadPoolExecutor : public ThreadPoolExecutor, public IOExecutor {
   explicit IOThreadPoolExecutor(
       size_t numThreads,
       std::shared_ptr<ThreadFactory> threadFactory =
-          std::make_shared<NamedThreadFactory>("IOThreadPool"));
+          std::make_shared<NamedThreadFactory>("IOThreadPool"),
+      EventBaseManager* ebm = folly::EventBaseManager::get());
 
   ~IOThreadPoolExecutor();
 
@@ -43,6 +44,8 @@ class IOThreadPoolExecutor : public ThreadPoolExecutor, public IOExecutor {
 
   static EventBase* getEventBase(ThreadPoolExecutor::ThreadHandle*);
 
+  EventBaseManager* getEventBaseManager();
+
  private:
   struct FOLLY_ALIGN_TO_AVOID_FALSE_SHARING IOThread : public Thread {
     IOThread(IOThreadPoolExecutor* pool)
@@ -62,6 +65,7 @@ class IOThreadPoolExecutor : public ThreadPoolExecutor, public IOExecutor {
 
   size_t nextThread_;
   ThreadLocal<std::shared_ptr<IOThread>> thisThread_;
+  EventBaseManager* eventBaseManager_;
 };
 
 }} // folly::wangle