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

Comparing jsr166/src/main/java/util/concurrent/LinkedBlockingDeque.java (file contents):
Revision 1.16 by dl, Fri Sep 16 11:15:44 2005 UTC vs.
Revision 1.17 by jsr166, Fri Sep 23 18:08:35 2005 UTC

# Line 299 | Line 299 | public class LinkedBlockingDeque<E>
299      public boolean offerFirst(E e, long timeout, TimeUnit unit)
300          throws InterruptedException {
301          if (e == null) throw new NullPointerException();
302 +        long nanos = unit.toNanos(timeout);
303          lock.lockInterruptibly();
304          try {
304            long nanos = unit.toNanos(timeout);
305              for (;;) {
306                  if (linkFirst(e))
307                      return true;
# Line 321 | Line 321 | public class LinkedBlockingDeque<E>
321      public boolean offerLast(E e, long timeout, TimeUnit unit)
322          throws InterruptedException {
323          if (e == null) throw new NullPointerException();
324 +        long nanos = unit.toNanos(timeout);
325          lock.lockInterruptibly();
326          try {
326            long nanos = unit.toNanos(timeout);
327              for (;;) {
328                  if (linkLast(e))
329                      return true;
# Line 398 | Line 398 | public class LinkedBlockingDeque<E>
398  
399      public E pollFirst(long timeout, TimeUnit unit)
400          throws InterruptedException {
401 +        long nanos = unit.toNanos(timeout);
402          lock.lockInterruptibly();
403          try {
403            long nanos = unit.toNanos(timeout);
404              for (;;) {
405                  E x = unlinkFirst();
406                  if (x != null)
# Line 416 | Line 416 | public class LinkedBlockingDeque<E>
416  
417      public E pollLast(long timeout, TimeUnit unit)
418          throws InterruptedException {
419 +        long nanos = unit.toNanos(timeout);
420          lock.lockInterruptibly();
421          try {
421            long nanos = unit.toNanos(timeout);
422              for (;;) {
423                  E x = unlinkLast();
424                  if (x != null)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines