15 #include <glog/logging.h> 24 : eventBaseManager_(eventBaseManager) {
28 if (!evbName.empty()) {
45 thread_ = std::thread([&]()
mutable {
67 LOG(FATAL) <<
"stopWhenIdle() called in unexpected state " <<
85 LOG(FATAL) <<
"forceStop() called in unexpected state " <<
104 sigaddset(&ss, SIGHUP);
105 sigaddset(&ss, SIGINT);
106 sigaddset(&ss, SIGQUIT);
107 sigaddset(&ss, SIGUSR1);
108 sigaddset(&ss, SIGUSR2);
109 sigaddset(&ss, SIGPIPE);
110 sigaddset(&ss, SIGALRM);
111 sigaddset(&ss, SIGTERM);
112 sigaddset(&ss, SIGCHLD);
113 sigaddset(&ss, SIGIO);
114 PCHECK(pthread_sigmask(SIG_BLOCK, &ss,
nullptr) == 0);
139 VLOG(1) <<
"WorkerThread " <<
this <<
" starting";
149 VLOG(1) <<
"WorkerThread " <<
this <<
" finishing non-internal events";
156 VLOG(1) <<
"WorkerThread " <<
this <<
" terminated";
static FOLLY_TLS WorkerThread * currentWorker_
void setEventBase(EventBase *eventBase, bool takeOwnership)
folly::EventBase eventBase_
WorkerThread(folly::EventBaseManager *ebm, const std::string &evbName=std::string())
folly::EventBaseManager * eventBaseManager_
GuardImpl guard(ErrorHandler &&handler)
bool runInEventBaseThread(void(*fn)(T *), T *arg)
void setName(const std::string &name)