ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.232 by jsr166, Mon May 29 19:15:02 2017 UTC vs.
Revision 1.233 by jsr166, Sat Jul 15 23:15:21 2017 UTC

# Line 1951 | Line 1951 | public class JSR166TestCase extends Test
1951                                 1000L, MILLISECONDS,
1952                                 new SynchronousQueue<Runnable>());
1953  
1954 +    /**
1955 +     * Returns maximum number of tasks that can be submitted to given
1956 +     * pool (with bounded queue) before saturation (when submission
1957 +     * throws RejectedExecutionException).
1958 +     */
1959 +    static final int saturatedSize(ThreadPoolExecutor pool) {
1960 +        BlockingQueue<Runnable> q = pool.getQueue();
1961 +        return pool.getMaximumPoolSize() + q.size() + q.remainingCapacity();
1962 +    }
1963 +
1964      static <T> void shuffle(T[] array) {
1965          Collections.shuffle(Arrays.asList(array), ThreadLocalRandom.current());
1966      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines