diff --git a/deps/common/seda/thread_pool.cpp b/deps/common/seda/thread_pool.cpp index 5652447b9c2441f6b43c13f5ba5205262e30cd54..bdc4f594fb8b7ad9ee45555ce9aa56a4523673dd 100644 --- a/deps/common/seda/thread_pool.cpp +++ b/deps/common/seda/thread_pool.cpp @@ -107,6 +107,9 @@ unsigned int Threadpool::add_threads(unsigned int threads) LOG_WARN("Failed to create one thread\n"); break; } + char tmp[16] = {}; + snprintf(tmp,sizeof(tmp), "%s%u",name_.c_str(), i); + pthread_setname_np(pthread, tmp); } nthreads_ += i; MUTEX_UNLOCK(&thread_mutex_); diff --git a/deps/common/seda/timer_stage.cpp b/deps/common/seda/timer_stage.cpp index c2c35562197165456e5ffc4c7977c03e0bf9ef37..3345a401395a4812e5fb3673ff6fc6d3beb202ba 100644 --- a/deps/common/seda/timer_stage.cpp +++ b/deps/common/seda/timer_stage.cpp @@ -295,6 +295,8 @@ bool TimerStage::initialize() int status = pthread_create(&timer_thread_id_, thread_attrs, &TimerStage::start_timer_thread, thread_args); if (status != 0) LOG_ERROR("failed to create timer thread: status=%d\n", status); + else + pthread_setname_np(timer_thread_id_, "TimerStage"); return (status == 0); }