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 |
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()) |
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()) |