base/common/src/main/com/thesett/common/util/concurrent/BatchSynchQueueBase.java
public SynchRef drainTo(Collection<SynchRecord<E>> c, boolean unblock)
    {
        return drainTo(c, -1, unblock);
    }
public SynchRef drainTo(Collection<SynchRecord<E>> c, boolean unblock)
    {
        return drainTo(c, -1, unblock);
    }
Takes all available data items from the queue or blocks until some become available. The returned items are
wrapped in a {@link SynchRecord} which provides an interface to requeue them or send errors to their producers,
where the producers are still blocked.

@param  c       The collection to drain the data items into.
@param  unblock If set to <tt>true</tt> the producers for the taken items will be immediately unblocked.

@return A count of the number of elements that were drained from the queue.