proxygen
|
#include <TestExecutor.h>
Public Member Functions | |
TestExecutor (size_t numThreads) | |
~TestExecutor () override | |
void | add (Func f) override |
size_t | numThreads () const |
Public Member Functions inherited from folly::Executor | |
virtual | ~Executor () |
virtual void | addWithPriority (Func, int8_t priority) |
virtual uint8_t | getNumPriorities () const |
Private Member Functions | |
void | addImpl (Func f) |
Private Attributes | |
std::mutex | m_ |
std::queue< Func > | workItems_ |
std::condition_variable | cv_ |
std::vector< std::thread > | workers_ |
Additional Inherited Members | |
Static Public Member Functions inherited from folly::Executor | |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | getKeepAliveToken (ExecutorT *executor) |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | getKeepAliveToken (ExecutorT &executor) |
Static Public Attributes inherited from folly::Executor | |
static const int8_t | LO_PRI = SCHAR_MIN |
static const int8_t | MID_PRI = 0 |
static const int8_t | HI_PRI = SCHAR_MAX |
Protected Member Functions inherited from folly::Executor | |
virtual bool | keepAliveAcquire () |
virtual void | keepAliveRelease () |
Static Protected Member Functions inherited from folly::Executor | |
template<typename ExecutorT > | |
static bool | isKeepAliveDummy (const KeepAlive< ExecutorT > &keepAlive) |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | makeKeepAlive (ExecutorT *executor) |
A simple multithreaded executor for use in tests etc
Definition at line 30 of file TestExecutor.h.
|
explicit |
|
override |
Definition at line 44 of file TestExecutor.cpp.
|
overridevirtual |
Enqueue a function to executed by this executor. This and all variants must be threadsafe.
Implements folly::Executor.
Definition at line 55 of file TestExecutor.cpp.
References folly::gen::move.
|
private |
size_t folly::TestExecutor::numThreads | ( | ) | const |
Definition at line 61 of file TestExecutor.cpp.
|
private |
Definition at line 45 of file TestExecutor.h.
|
private |
Definition at line 43 of file TestExecutor.h.
|
private |
Definition at line 47 of file TestExecutor.h.
|
private |
Definition at line 44 of file TestExecutor.h.