Problem: Threads don't have names which complicates debugging.

Solution:
1. Use optional name parameter in thread_t::start for operating
systems that have thread names.
2. Give start_thread() an optional name parameter for the
thread's name. If this parameter is set, it will be appended to "0MQ:".
If not set, "0MQ" will be used as the thread's name.
3. Give epoll the ability to name its thread. Then use this in
io_thread and reaper to name them.
This commit is contained in:
Kymeta Corp
2019-01-29 12:07:33 +02:00
committed by Luca Boccassi
parent c47b2af90a
commit 484374f2b6
8 changed files with 28 additions and 12 deletions

View File

@@ -56,8 +56,10 @@ zmq::io_thread_t::~io_thread_t ()
void zmq::io_thread_t::start ()
{
char name[16];
snprintf(name, sizeof(name), "IO %u", get_tid() - zmq::ctx_t::reaper_tid);
// Start the underlying I/O thread.
_poller->start ();
_poller->start (name);
}
void zmq::io_thread_t::stop ()