{
synchronized (PageSubscriptionImpl.this)
{
boolean match = false;
PagedReference message = null;
PagePosition lastPosition = position;
PagePosition tmpPosition = position;
do
{
synchronized (redeliveries)
{
PagePosition redelivery = redeliveries.poll();
if (redelivery != null)
{
// There's a redelivery pending, we will get it out of that pool instead
isredelivery = true;
PagedReference redeliveredMsg = getReference(redelivery);
lastRedelivery = redeliveredMsg;
return redeliveredMsg;
}
else