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

Comparing jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java (file contents):
Revision 1.131 by jsr166, Sat Apr 28 16:25:34 2018 UTC vs.
Revision 1.132 by jsr166, Sun May 6 02:15:03 2018 UTC

# Line 979 | Line 979 | public class PriorityBlockingQueue<E> ex
979          return new PBQSpliterator();
980      }
981  
982 +    /**
983 +     * @throws NullPointerException {@inheritDoc}
984 +     */
985 +    public void forEach(Consumer<? super E> action) {
986 +        Objects.requireNonNull(action);
987 +        final ReentrantLock lock = this.lock;
988 +        lock.lock();
989 +        try {
990 +            final Object[] es = queue;
991 +            for (int i = 0, n = size; i < n; i++)
992 +                action.accept((E) es[i]);
993 +        } finally {
994 +            lock.unlock();
995 +        }
996 +    }
997 +
998      // VarHandle mechanics
999      private static final VarHandle ALLOCATIONSPINLOCK;
1000      static {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines