ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/LinkedBlockingQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/LinkedBlockingQueue.java (file contents):
Revision 1.40 by jsr166, Tue Apr 26 01:17:18 2005 UTC vs.
Revision 1.41 by jsr166, Mon May 2 02:47:17 2005 UTC

# Line 208 | Line 208 | public class LinkedBlockingQueue<E> exte
208      // this doc comment is a modified copy of the inherited doc comment,
209      // without the reference to unlimited queues.
210      /**
211 <     * Returns the number of elements that this queue can ideally (in
212 <     * the absence of memory or resource constraints) accept without
211 >     * Returns the number of additional elements that this queue can ideally
212 >     * (in the absence of memory or resource constraints) accept without
213       * blocking. This is always equal to the initial capacity of this queue
214       * less the current <tt>size</tt> of this queue.
215 <     * <p>Note that you <em>cannot</em> always tell if
216 <     * an attempt to <tt>add</tt> an element will succeed by
217 <     * inspecting <tt>remainingCapacity</tt> because it may be the
218 <     * case that a waiting consumer is ready to <tt>take</tt> an
219 <     * element out of an otherwise full queue.
215 >     *
216 >     * <p>Note that you <em>cannot</em> always tell if an attempt to insert
217 >     * an element will succeed by inspecting <tt>remainingCapacity</tt>
218 >     * because it may be the case that another thread is about to
219 >     * <tt>put</tt> or <tt>take</tt> an element.
220       */
221      public int remainingCapacity() {
222          return capacity - count.get();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines