mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-21 02:00:36 +01:00
Execute the timers before pollset initialisation.
Since executing the timers might modify the source pollsets we have to defer the initialisation until after the timers have executed. Signed-off-by: Christian Gudrian <christian.gudrian@fluidon.com>
This commit is contained in:
parent
318cdd1f24
commit
f5030a93a5
1
AUTHORS
1
AUTHORS
@ -8,6 +8,7 @@ Bernd Prager <bernd@prager.ws>
|
|||||||
Bernd Melchers <melchers@ZEDAT.FU-Berlin.DE>
|
Bernd Melchers <melchers@ZEDAT.FU-Berlin.DE>
|
||||||
Brian Buchanan <bwb@holo.org>
|
Brian Buchanan <bwb@holo.org>
|
||||||
Chris Wong <chris@chriswongstudio.com>
|
Chris Wong <chris@chriswongstudio.com>
|
||||||
|
Christian Gudrian <christian.gudrian@fluidon.com>
|
||||||
Conrad D. Steenberg <conrad.steenberg@caltech.edu>
|
Conrad D. Steenberg <conrad.steenberg@caltech.edu>
|
||||||
Dhammika Pathirana <dhammika@gmail.com>
|
Dhammika Pathirana <dhammika@gmail.com>
|
||||||
Dhruva Krishnamurthy <dhruva@ymail.com>
|
Dhruva Krishnamurthy <dhruva@ymail.com>
|
||||||
|
@ -147,14 +147,14 @@ void zmq::select_t::loop ()
|
|||||||
{
|
{
|
||||||
while (!stopping) {
|
while (!stopping) {
|
||||||
|
|
||||||
|
// Execute any due timers.
|
||||||
|
uint64_t timeout = execute_timers ();
|
||||||
|
|
||||||
// Intialise the pollsets.
|
// Intialise the pollsets.
|
||||||
memcpy (&readfds, &source_set_in, sizeof source_set_in);
|
memcpy (&readfds, &source_set_in, sizeof source_set_in);
|
||||||
memcpy (&writefds, &source_set_out, sizeof source_set_out);
|
memcpy (&writefds, &source_set_out, sizeof source_set_out);
|
||||||
memcpy (&exceptfds, &source_set_err, sizeof source_set_err);
|
memcpy (&exceptfds, &source_set_err, sizeof source_set_err);
|
||||||
|
|
||||||
// Execute any due timers.
|
|
||||||
uint64_t timeout = execute_timers ();
|
|
||||||
|
|
||||||
// Wait for events.
|
// Wait for events.
|
||||||
struct timeval tv = {(long) (timeout / 1000),
|
struct timeval tv = {(long) (timeout / 1000),
|
||||||
(long) (timeout % 1000 * 1000)};
|
(long) (timeout % 1000 * 1000)};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user