ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/util/uk/org/iscream/cms/util/Queue.java
(Generate patch)

Comparing projects/cms/source/util/uk/org/iscream/cms/util/Queue.java (file contents):
Revision 1.5 by tdb, Fri Jan 19 01:11:55 2001 UTC vs.
Revision 1.7 by tdb, Tue Jan 30 01:56:28 2001 UTC

# Line 88 | Line 88 | public class Queue {
88          }
89          return o;
90      }
91 <      
91 >    
92 >    /**
93 >     * This method releases a get() method that's currently
94 >     * waiting on an empty queue. This was designed for
95 >     * shutdown() type methods that may have problems closing
96 >     * if the thread of control is waiting on a queue.
97 >     *
98 >     * @param queue the queue to release
99 >     */
100 >    public void releaseQueue(int queue) {
101 >        synchronized(((LinkedList) _lists.get(queue))) {
102 >                ((LinkedList) _lists.get(queue)).notifyAll();
103 >        }
104 >    }
105 >
106 >    /**
107 >     * This method erases the contents of a given queue. This
108 >     * method should be used with care. It can only empty one
109 >     * internal queue, not all of them. This must be called
110 >     * multiple times to empty all queues.
111 >     *
112 >     * @param queue the queue to empty.
113 >     */
114 >    public void clearQueue(int queue) {
115 >        synchronized(this) {
116 >            ((LinkedList) _lists.get(queue)).clear();
117 >        }
118 >    }
119 >    
120      /**
121       * This method returns a textual status of the queues. It
122       * is merely for observation, and would most likely be used

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines