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 |
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. |