#include <folly/executors/IOThreadPoolExecutor.h>
#include <glog/logging.h>
#include <folly/detail/MemoryIdler.h>
#include <folly/portability/GFlags.h>
FOLLY_GFLAGS_DEFINE_bool(…);
namespace folly {
namespace {
MemoryIdler;
class MemoryIdlerTimeout : public AsyncTimeout, public EventBase::LoopCallback { … };
}
EventBase* IOThreadPoolExecutor::getEventBase(
ThreadPoolExecutor::ThreadHandle* h) { … }
IOThreadPoolExecutor::IOThreadPoolExecutor(
size_t numThreads,
std::shared_ptr<ThreadFactory> threadFactory,
EventBaseManager* ebm,
Options options)
: … { … }
IOThreadPoolExecutor::IOThreadPoolExecutor(
size_t maxThreads,
size_t minThreads,
std::shared_ptr<ThreadFactory> threadFactory,
EventBaseManager* ebm,
Options options)
: … { … }
IOThreadPoolExecutor::~IOThreadPoolExecutor() { … }
void IOThreadPoolExecutor::add(Func func) { … }
void IOThreadPoolExecutor::add(
Func func, std::chrono::milliseconds expiration, Func expireCallback) { … }
std::shared_ptr<IOThreadPoolExecutor::IOThread>
IOThreadPoolExecutor::pickThread() { … }
EventBase* IOThreadPoolExecutor::getEventBase() { … }
std::vector<Executor::KeepAlive<EventBase>>
IOThreadPoolExecutor::getAllEventBases() { … }
EventBaseManager* IOThreadPoolExecutor::getEventBaseManager() { … }
std::shared_ptr<ThreadPoolExecutor::Thread> IOThreadPoolExecutor::makeThread() { … }
void IOThreadPoolExecutor::threadRun(ThreadPtr thread) { … }
void IOThreadPoolExecutor::stopThreads(size_t n) { … }
size_t IOThreadPoolExecutor::getPendingTaskCountImpl() const { … }
void IOThreadPoolExecutor::handleObserverRegisterThread(
ThreadHandle* h, Observer& observer) { … }
void IOThreadPoolExecutor::handleObserverUnregisterThread(
ThreadHandle* h, Observer& observer) { … }
}