EventBaseThread::EventBaseThread() : EventBaseThread(true) {}
-EventBaseThread::EventBaseThread(bool autostart, EventBaseManager* ebm)
+EventBaseThread::EventBaseThread(
+ bool autostart,
+ EventBaseManager* ebm,
+ folly::StringPiece threadName)
: ebm_(ebm) {
if (autostart) {
- start();
+ start(threadName);
}
}
return !!th_;
}
-void EventBaseThread::start() {
+void EventBaseThread::start(folly::StringPiece threadName) {
if (th_) {
return;
}
- th_ = make_unique<ScopedEventBaseThread>(ebm_);
+ th_ = std::make_unique<ScopedEventBaseThread>(ebm_, threadName);
}
void EventBaseThread::stop() {