mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-14 09:47:56 +08:00
Fix a bug that zmq_poll's select backend spins when timeout=-1, due to
ptimeout not properly recalculated after first pass. Signed-off-by: Chia-liang Kao <clkao@clkao.org>
This commit is contained in:
parent
8abe67357a
commit
a2500ae348
1
AUTHORS
1
AUTHORS
@ -8,6 +8,7 @@ Bernd Prager <bernd@prager.ws>
|
||||
Bernd Melchers <melchers@ZEDAT.FU-Berlin.DE>
|
||||
Brian Buchanan <bwb@holo.org>
|
||||
Burak Arslan <burak-github@arskom.com.tr>
|
||||
Chia-liang Kao <clkao@clkao.org>
|
||||
Chris Wong <chris@chriswongstudio.com>
|
||||
Christian Gudrian <christian.gudrian@fluidon.com>
|
||||
Conrad D. Steenberg <conrad.steenberg@caltech.edu>
|
||||
|
@ -545,6 +545,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||
int nevents = 0;
|
||||
fd_set inset, outset, errset;
|
||||
|
||||
while (true) {
|
||||
|
||||
// Compute the timeout for the subsequent poll.
|
||||
timeval timeout;
|
||||
timeval *ptimeout;
|
||||
@ -561,8 +563,6 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||
ptimeout = &timeout;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
|
||||
// Wait for events. Ignore interrupts if there's infinite timeout.
|
||||
while (true) {
|
||||
memcpy (&inset, &pollset_in, sizeof (fd_set));
|
||||
|
Loading…
x
Reference in New Issue
Block a user