Code example for PriorityBlockingQueue

0
	} 
 
	private abstract class PhotosLoaderBase 
		extends Thread
	{ 
		protected PriorityBlockingQueue < PhotoToLoad >	tasks	= new PriorityBlockingQueue < PhotoToLoad >();
 
		public void discard(ImageView image)
		{ 
			if (image == null)
				return; 
 
			for (PhotoToLoad task : tasks)
				if (task.mImage == image)
					tasks.remove( task );
		} 
 
		public void discardAllNoImage() 
		{ 
			for (PhotoToLoad task : tasks)
				if (task.mImage == null)