mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 05:29:43 +01:00
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:
committed by
Luca Boccassi
parent
c47b2af90a
commit
484374f2b6
@@ -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 ()
|
||||
|
||||
Reference in New Issue
Block a user