673 |
|
} |
674 |
|
|
675 |
|
/** |
676 |
< |
* Nulls out record of worker in workers array |
676 |
> |
* Nulls out record of worker in workers array. |
677 |
|
*/ |
678 |
|
private void forgetWorker(ForkJoinWorkerThread w) { |
679 |
|
int idx = w.poolIndex; |
1106 |
|
c = eventCount, c+1); |
1107 |
|
eventWaiters = 0L; // clobber lists |
1108 |
|
spareWaiters = 0; |
1109 |
< |
ForkJoinWorkerThread[] ws = workers; |
1110 |
< |
int n = ws.length; |
1111 |
< |
for (int i = 0; i < n; ++i) { |
1112 |
< |
ForkJoinWorkerThread w = ws[i]; |
1109 |
> |
for (ForkJoinWorkerThread w : workers) { |
1110 |
|
if (w != null) { |
1111 |
|
w.shutdown(); |
1112 |
|
if (passes > 0 && !w.isTerminated()) { |
1523 |
|
*/ |
1524 |
|
public long getQueuedTaskCount() { |
1525 |
|
long count = 0; |
1526 |
< |
ForkJoinWorkerThread[] ws = workers; |
1530 |
< |
int n = ws.length; |
1531 |
< |
for (int i = 0; i < n; ++i) { |
1532 |
< |
ForkJoinWorkerThread w = ws[i]; |
1526 |
> |
for (ForkJoinWorkerThread w : workers) |
1527 |
|
if (w != null) |
1528 |
|
count += w.getQueueSize(); |
1535 |
– |
} |
1529 |
|
return count; |
1530 |
|
} |
1531 |
|
|
1580 |
|
*/ |
1581 |
|
protected int drainTasksTo(Collection<? super ForkJoinTask<?>> c) { |
1582 |
|
int count = submissionQueue.drainTo(c); |
1583 |
< |
ForkJoinWorkerThread[] ws = workers; |
1591 |
< |
int n = ws.length; |
1592 |
< |
for (int i = 0; i < n; ++i) { |
1593 |
< |
ForkJoinWorkerThread w = ws[i]; |
1583 |
> |
for (ForkJoinWorkerThread w : workers) |
1584 |
|
if (w != null) |
1585 |
|
count += w.drainTasksTo(c); |
1596 |
– |
} |
1586 |
|
return count; |
1587 |
|
} |
1588 |
|
|