--- projects/cms/source/util/uk/org/iscream/cms/util/Queue.java 2001/01/23 18:22:28 1.6 +++ projects/cms/source/util/uk/org/iscream/cms/util/Queue.java 2001/01/30 01:56:28 1.7 @@ -13,7 +13,7 @@ import uk.ac.ukc.iscream.util.*; * actually contains some elements. * * @author $Author: tdb $ - * @version $Id: Queue.java,v 1.6 2001/01/23 18:22:28 tdb Exp $ + * @version $Id: Queue.java,v 1.7 2001/01/30 01:56:28 tdb Exp $ */ public class Queue { @@ -22,7 +22,7 @@ public class Queue { /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.6 $"; + public static final String REVISION = "$Revision: 1.7 $"; //---STATIC METHODS--- @@ -100,6 +100,20 @@ public class Queue { public void releaseQueue(int queue) { synchronized(((LinkedList) _lists.get(queue))) { ((LinkedList) _lists.get(queue)).notifyAll(); + } + } + + /** + * This method erases the contents of a given queue. This + * method should be used with care. It can only empty one + * internal queue, not all of them. This must be called + * multiple times to empty all queues. + * + * @param queue the queue to empty. + */ + public void clearQueue(int queue) { + synchronized(this) { + ((LinkedList) _lists.get(queue)).clear(); } }