[concurrency-interest] Fwd: ThreadPoolTask

David Holmes dcholmes at optusnet.com.au
Mon Jul 10 00:17:09 EDT 2006


Jean Morissette writes:
> 	private static class CopiesQueue extends AbstractQueue implements
> BlockingQueue {
>
> 		AtomicInteger size;
> 		Object element;
>
> 		public CopiesQueue(int initialSize, Object element) {
> 			size = new AtomicInteger(initialSize);
> 			this.element = element;
> 		}
>
> 		public boolean offer(Object o) {
> 			size.incrementAndGet();
> 			return true;
> 		}

...

I don't get it. Other than going up and down, size is never used to
influence any control flow. ???

David



More information about the Concurrency-interest mailing list