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.115 by jsr166, Sat Sep 19 20:52:58 2015 UTC vs.
Revision 1.116 by jsr166, Sat Sep 19 21:07:11 2015 UTC

# Line 167 | Line 167 | public class SynchronousQueue<E> extends
167       * seems not to vary with number of CPUs (beyond 2) so is just
168       * a constant.
169       */
170 <    static final int maxTimedSpins = (NCPUS < 2) ? 0 : 32;
170 >    static final int MAX_TIMED_SPINS = (NCPUS < 2) ? 0 : 32;
171  
172      /**
173       * The number of times to spin before blocking in untimed waits.
174       * This is greater than timed value because untimed waits spin
175       * faster since they don't need to check times on each spin.
176       */
177 <    static final int maxUntimedSpins = maxTimedSpins * 16;
177 >    static final int MAX_UNTIMED_SPINS = MAX_TIMED_SPINS * 16;
178  
179      /**
180       * The number of nanoseconds for which it is faster to spin
# Line 409 | Line 409 | public class SynchronousQueue<E> extends
409              final long deadline = timed ? System.nanoTime() + nanos : 0L;
410              Thread w = Thread.currentThread();
411              int spins = shouldSpin(s)
412 <                ? (timed ? maxTimedSpins : maxUntimedSpins)
412 >                ? (timed ? MAX_TIMED_SPINS : MAX_UNTIMED_SPINS)
413                  : 0;
414              for (;;) {
415                  if (w.isInterrupted())
# Line 710 | Line 710 | public class SynchronousQueue<E> extends
710              final long deadline = timed ? System.nanoTime() + nanos : 0L;
711              Thread w = Thread.currentThread();
712              int spins = (head.next == s)
713 <                ? (timed ? maxTimedSpins : maxUntimedSpins)
713 >                ? (timed ? MAX_TIMED_SPINS : MAX_UNTIMED_SPINS)
714                  : 0;
715              for (;;) {
716                  if (w.isInterrupted())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines