Commit 3de11633 authored by Claudio Freire's avatar Claudio Freire

Fix busy-polling bug in pgm_sender causing it to consume CPU cycles

parent fca34e5e
......@@ -210,8 +210,10 @@ void zmq::pgm_sender_t::out_event ()
zmq_assert (nbytes == 0);
if (errno == ENOMEM) {
// Stop polling handle and wait for tx timeout
const long timeout = pgm_socket.get_tx_timeout ();
add_timer (timeout, tx_timer_id);
reset_pollout (handle);
has_tx_timer = true;
}
else
......@@ -228,7 +230,9 @@ void zmq::pgm_sender_t::timer_event (int token)
}
else
if (token == tx_timer_id) {
// Restart polling handle and retry sending
has_tx_timer = false;
set_pollout (handle);
out_event ();
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment