class ConcurrentQ {

	public QResult<I, R> waitForNextResult() throws InterruptedException {
		if (!collectResults) {
			throw new IllegalStateException(
				"Can't wait for next result when not collecting results");
		}
		lock.lockInterruptibly();
		try {
			if (resultList.isEmpty()) {
				if (isEmpty()) {
					return null;
				}

				tracker.waitForNext();
			}
			return resultList.pop();
		}
		finally {
			lock.unlock();
		}
	}

	public  ConcurrentQ(String name, QCallback<I, R> callback);
	public  ConcurrentQ(QCallback<I, R> callback, Queue<I> queue, GThreadPool threadPool,
			QItemListener<I, R> listener, boolean collectResults, int maxInProgress,
			boolean jobsReportProgress);

}