summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d3e97eb)
: prefix_(prefix.str()), suffix_(0) {}
std::thread newThread(Func&& func) override {
: prefix_(prefix.str()), suffix_(0) {}
std::thread newThread(Func&& func) override {
- auto thread = std::thread(std::move(func));
- folly::setThreadName(
- thread.native_handle(), folly::to<std::string>(prefix_, suffix_++));
- return thread;
+ auto name = folly::to<std::string>(prefix_, suffix_++);
+ return std::thread(
+ [ func = std::move(func), name = std::move(name) ]() mutable {
+ folly::setThreadName(name);
+ func();
+ });
}
void setNamePrefix(folly::StringPiece prefix) {
}
void setNamePrefix(folly::StringPiece prefix) {