384 |
|
* |
385 |
|
* @param parallelism the parallelism level |
386 |
|
* @throws IllegalArgumentException if parallelism less than or |
387 |
< |
* equal to zero |
387 |
> |
* equal to zero, or greater than implementation limit |
388 |
|
* @throws SecurityException if a security manager exists and |
389 |
|
* the caller is not permitted to modify threads |
390 |
|
* because it does not hold {@link |
417 |
|
* @param parallelism the parallelism level |
418 |
|
* @param factory the factory for creating new threads |
419 |
|
* @throws IllegalArgumentException if parallelism less than or |
420 |
< |
* equal to zero, or greater than implementation limit |
420 |
> |
* equal to zero, or greater than implementation limit |
421 |
|
* @throws NullPointerException if factory is null |
422 |
|
* @throws SecurityException if a security manager exists and |
423 |
|
* the caller is not permitted to modify threads |
1578 |
|
while (spareStack == null || !tryResumeSpare(dec)) { |
1579 |
|
int counts = workerCounts; |
1580 |
|
if (dec || (dec = casWorkerCounts(counts, --counts))) { |
1581 |
– |
// CAS cheat |
1581 |
|
if (!needSpare(counts, maintainParallelism)) |
1582 |
|
break; |
1583 |
|
if (joinMe.status < 0) |