proxygen
|
Simple executor that does work in another thread. More...
Public Member Functions | |
ThreadExecutor (size_t n=1024) | |
~ThreadExecutor () override | |
void | add (Func fn) override |
void | waitForStartup () |
![]() | |
virtual | ~Executor () |
virtual void | add (Func)=0 |
virtual void | addWithPriority (Func, int8_t priority) |
virtual uint8_t | getNumPriorities () const |
Private Member Functions | |
void | work () |
Private Attributes | |
folly::MPMCQueue< Func > | funcs |
std::atomic< bool > | done {false} |
std::thread | worker |
folly::Baton | baton |
Additional Inherited Members | |
![]() | |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | getKeepAliveToken (ExecutorT *executor) |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | getKeepAliveToken (ExecutorT &executor) |
![]() | |
static const int8_t | LO_PRI = SCHAR_MIN |
static const int8_t | MID_PRI = 0 |
static const int8_t | HI_PRI = SCHAR_MAX |
![]() | |
virtual bool | keepAliveAcquire () |
virtual void | keepAliveRelease () |
![]() | |
template<typename ExecutorT > | |
static bool | isKeepAliveDummy (const KeepAlive< ExecutorT > &keepAlive) |
template<typename ExecutorT > | |
static KeepAlive< ExecutorT > | makeKeepAlive (ExecutorT *executor) |
Simple executor that does work in another thread.
Definition at line 314 of file ViaTest.cpp.
|
inlineexplicit |
Definition at line 332 of file ViaTest.cpp.
References folly::netops::bind(), and work().
|
inlineoverride |
Definition at line 336 of file ViaTest.cpp.
|
inlineoverride |
|
inline |
Definition at line 346 of file ViaTest.cpp.
References folly::Baton< MayBlock, Atom >::wait().
Referenced by TEST().
|
inlineprivate |
Definition at line 320 of file ViaTest.cpp.
References folly::Baton< MayBlock, Atom >::post().
Referenced by ThreadExecutor().
|
private |
Definition at line 318 of file ViaTest.cpp.
|
private |
Definition at line 316 of file ViaTest.cpp.
|
private |
Definition at line 315 of file ViaTest.cpp.
|
private |
Definition at line 317 of file ViaTest.cpp.