ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collections/RacingCollections.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collections/RacingCollections.java (file contents):
Revision 1.4 by jsr166, Mon Sep 27 19:15:15 2010 UTC vs.
Revision 1.7 by jsr166, Tue Sep 15 06:41:44 2015 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
2 > * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4   *
5   * This code is free software; you can redistribute it and/or modify it
# Line 62 | Line 62 | public class RacingCollections {
62              this.start();
63          }
64  
65 <        @SuppressWarnings("unchecked") void clear(Object o) {
65 >        @SuppressWarnings("unchecked")
66 >        void clear(Object o) {
67              if (o instanceof Collection)
68                  ((Collection<?>)o).clear();
69              else
70                  ((Map<?,?>)o).clear();
71          }
72  
73 <        @SuppressWarnings("unchecked") void realRun() {
73 >        @SuppressWarnings("unchecked")
74 >        void realRun() {
75              // Mutate elLoco wildly forever, checking occasionally for "done"
76              clear(elLoco);
77              if (elLoco instanceof List) {
# Line 156 | Line 158 | public class RacingCollections {
158              quittingTime = System.nanoTime() + workTimeMillis * 1024 * 1024;
159          }
160          boolean keepGoing() {
161 <            return (i++ % 128 != 0) || (System.nanoTime() < quittingTime);
161 >            return (i++ % 128 != 0) || (System.nanoTime() - quittingTime < 0);
162          }
163      }
164  
# Line 233 | Line 235 | public class RacingCollections {
235      private static List<Queue<Integer>> newConcurrentQueues() {
236          List<Queue<Integer>> list =
237              new ArrayList<Queue<Integer>>(newConcurrentDeques());
238 +        list.add(new ArrayBlockingQueue<Integer>(10));
239          list.add(new LinkedBlockingQueue<Integer>(10));
240          list.add(new LinkedTransferQueue<Integer>());
241          list.add(new ConcurrentLinkedQueue<Integer>());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines