From 6d4ffd90dbda943e5d1215fb56d06eeac1b4420f Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 7 Sep 2010 15:49:54 +0200 Subject: Bug in fq_t and lb_t (when used via ZMQ_EVENTS option) fixed --- src/fq.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/fq.cpp') diff --git a/src/fq.cpp b/src/fq.cpp index 7eef564..9832c21 100644 --- a/src/fq.cpp +++ b/src/fq.cpp @@ -148,8 +148,11 @@ bool zmq::fq_t::has_in () for (int count = active; count != 0; count--) { if (pipes [current]->check_read ()) return true; - current++; - if (current >= active) + + // Deactivate the pipe. + active--; + pipes.swap (current, active); + if (current == active) current = 0; } -- cgit v1.2.3