#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>
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();
EventBase* getEventBase() override;
- EventBase* getEventBase(ThreadPoolExecutor::ThreadHandle*);
+ static EventBase* getEventBase(ThreadPoolExecutor::ThreadHandle*);
+
+ EventBaseManager* getEventBaseManager();
private:
struct FOLLY_ALIGN_TO_AVOID_FALSE_SHARING IOThread : public Thread {
size_t nextThread_;
ThreadLocal<std::shared_ptr<IOThread>> thisThread_;
+ EventBaseManager* eventBaseManager_;
};
}} // folly::wangle