diff options
Diffstat (limited to 'cpp/src/qpid/broker/Queue.h')
| -rw-r--r-- | cpp/src/qpid/broker/Queue.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Queue.h b/cpp/src/qpid/broker/Queue.h index f247312b60..e554c1011a 100644 --- a/cpp/src/qpid/broker/Queue.h +++ b/cpp/src/qpid/broker/Queue.h @@ -66,11 +66,18 @@ namespace qpid { struct DispatchFunctor { Queue& queue; + Consumer::ptr consumer; DispatchCompletion* sync; + DispatchFunctor(Queue& q, DispatchCompletion* s = 0) : queue(q), sync(s) {} + DispatchFunctor(Queue& q, Consumer::ptr c, DispatchCompletion* s = 0) : queue(q), consumer(c), sync(s) {} void operator()() { - queue.dispatch(); + if (consumer && !consumer->preAcquires()) { + queue.serviceBrowser(consumer); + }else{ + queue.dispatch(); + } if (sync) sync->completed(); } }; |
