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

Comparing jsr166/src/test/loops/MultipleProducersSingleConsumerLoops.java (file contents):
Revision 1.12 by jsr166, Sat Dec 31 19:40:49 2016 UTC vs.
Revision 1.15 by jsr166, Sat Dec 31 21:34:47 2016 UTC

# Line 4 | Line 4
4   * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7 import java.util.Random;
7   import java.util.concurrent.ArrayBlockingQueue;
8   import java.util.concurrent.BlockingQueue;
9   import java.util.concurrent.CyclicBarrier;
# Line 19 | Line 18 | import java.util.concurrent.SynchronousQ
18  
19   public class MultipleProducersSingleConsumerLoops {
20      static final int NCPUS = Runtime.getRuntime().availableProcessors();
22    static final Random rng = new Random();
21      static final ExecutorService pool = Executors.newCachedThreadPool();
22      static boolean print = false;
23      static int producerSum;
# Line 255 | Line 253 | public class MultipleProducersSingleCons
253      static final class LTQasSQ<T> extends LinkedTransferQueue<T> {
254          LTQasSQ() { super(); }
255          public void put(T x) {
256 <            try { super.transfer(x);
257 <            } catch (InterruptedException ex) { throw new Error(); }
256 >            try { super.transfer(x); }
257 >            catch (InterruptedException ex) { throw new Error(ex); }
258          }
259      }
260  
# Line 267 | Line 265 | public class MultipleProducersSingleCons
265              if ((++calls & 1) == 0)
266                  super.put(x);
267              else {
268 <                try { super.transfer(x);
269 <                } catch (InterruptedException ex) {
272 <                    throw new Error();
273 <                }
268 >                try { super.transfer(x); }
269 >                catch (InterruptedException ex) { throw new Error(ex); }
270              }
271          }
272      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines