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

Comparing jsr166/src/main/java/util/concurrent/SynchronousQueue.java (file contents):
Revision 1.116 by jsr166, Sat Sep 19 21:07:11 2015 UTC vs.
Revision 1.117 by jsr166, Sat Oct 3 17:26:56 2015 UTC

# Line 157 | Line 157 | public class SynchronousQueue<E> extends
157          abstract E transfer(E e, boolean timed, long nanos);
158      }
159  
160    /** The number of CPUs, for spin control */
161    static final int NCPUS = Runtime.getRuntime().availableProcessors();
162
160      /**
161       * The number of times to spin before blocking in timed waits.
162       * The value is empirically derived -- it works well across a
# Line 167 | Line 164 | public class SynchronousQueue<E> extends
164       * seems not to vary with number of CPUs (beyond 2) so is just
165       * a constant.
166       */
167 <    static final int MAX_TIMED_SPINS = (NCPUS < 2) ? 0 : 32;
167 >    static final int MAX_TIMED_SPINS =
168 >        (Runtime.getRuntime().availableProcessors() < 2) ? 0 : 32;
169  
170      /**
171       * The number of times to spin before blocking in untimed waits.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines