msg/async: set thread name for msgr worker

Signed-off-by: Haomai Wang <haomai@xsky.com>
This commit is contained in:
Haomai Wang 2017-03-01 00:15:30 +08:00
parent 1f0824b72d
commit 26d1845d43

View File

@ -35,8 +35,11 @@ std::function<void ()> NetworkStack::add_thread(unsigned i)
{
Worker *w = workers[i];
return [this, w]() {
const uint64_t EventMaxWaitUs = 30000000;
w->center.set_owner();
char tp_name[16];
sprintf(tp_name, "msgr-worker-%d", w->id);
pthread_setname_np(pthread_self(), tp_name);
const uint64_t EventMaxWaitUs = 30000000;
w->center.set_owner();
ldout(cct, 10) << __func__ << " starting" << dendl;
w->initialize();
w->init_done();