216 |
|
* threads, packed into one int to ensure consistent snapshot when |
217 |
|
* making decisions about creating and suspending spare |
218 |
|
* threads. Updated only by CAS. Note: CASes in |
219 |
< |
* updateRunningCount and preJoin running active count is in low |
220 |
< |
* word, so need to be modified if this changes |
219 |
> |
* updateRunningCount and preJoin assume that running active count |
220 |
> |
* is in low word, so need to be modified if this changes |
221 |
|
*/ |
222 |
|
private volatile int workerCounts; |
223 |
|
|
430 |
|
|
431 |
|
/** |
432 |
|
* Create or resize array if necessary to hold newLength. |
433 |
< |
* Call only under exlusion or lock |
433 |
> |
* Call only under exclusion |
434 |
|
* @return the array |
435 |
|
*/ |
436 |
|
private ForkJoinWorkerThread[] ensureWorkerArrayCapacity(int newLength) { |
840 |
|
|
841 |
|
/** |
842 |
|
* Returns true if this pool uses local first-in-first-out |
843 |
< |
* scheduling mode for forked tasks that are never joined. |
843 |
> |
* scheduling mode for forked tasks that are never joined. |
844 |
|
* |
845 |
|
* @return true if this pool uses async mode. |
846 |
|
*/ |
1507 |
|
/** |
1508 |
|
* Same idea as preJoin |
1509 |
|
*/ |
1510 |
< |
final boolean preBlock(ManagedBlocker blocker, boolean maintainParallelism){ |
1510 |
> |
final boolean preBlock(ManagedBlocker blocker, |
1511 |
> |
boolean maintainParallelism) { |
1512 |
|
maintainParallelism &= maintainsParallelism; |
1513 |
|
boolean dec = false; |
1514 |
|
while (spareStack == null || !tryResumeSpare(dec)) { |