[PATCH] Execute the timers before pollset initialisation.
Christian Gudrian
christian.gudrian at fluidon.com
Thu Oct 7 13:56:11 CEST 2010
Since executing the timers might modify the source pollsets we have
to defer the initialisation until after the timers have executed.
---
src/select.cpp | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/select.cpp b/src/select.cpp
index f6e5133..16b130d 100644
--- a/src/select.cpp
+++ b/src/select.cpp
@@ -147,14 +147,14 @@ void zmq::select_t::loop ()
{
while (!stopping) {
+ // Execute any due timers.
+ uint64_t timeout = execute_timers ();
+
// Intialise the pollsets.
memcpy (&readfds, &source_set_in, sizeof source_set_in);
memcpy (&writefds, &source_set_out, sizeof source_set_out);
memcpy (&exceptfds, &source_set_err, sizeof source_set_err);
- // Execute any due timers.
- uint64_t timeout = execute_timers ();
-
// Wait for events.
struct timeval tv = {timeout / 1000, timeout % 1000 * 1000};
int rc = select (maxfd + 1, &readfds, &writefds, &exceptfds,
--
1.7.3.1.msysgit.0
--------------010706080404020302030301--
More information about the zeromq-dev
mailing list