#include <folly/experimental/observer/detail/ObserverManager.h>
#include <folly/ExceptionString.h>
+#include <folly/Format.h>
#include <folly/MPMCQueue.h>
+#include <folly/Range.h>
#include <folly/Singleton.h>
+#include <folly/ThreadName.h>
#include <folly/portability/GFlags.h>
namespace folly {
4,
"How many internal threads ObserverManager should use");
+static constexpr StringPiece kObserverManagerThreadNamePrefix{"ObserverMngr"};
+
namespace {
constexpr size_t kCurrentQueueSize{10 * 1024};
constexpr size_t kNextQueueSize{10 * 1024};
FLAGS_observer_manager_pool_size = 1;
}
for (int32_t i = 0; i < FLAGS_observer_manager_pool_size; ++i) {
- threads_.emplace_back([&]() {
+ threads_.emplace_back([this, i]() {
+ folly::setThreadName(
+ folly::sformat("{}{}", kObserverManagerThreadNamePrefix, i));
ObserverManager::inManagerThread_ = true;
while (true) {