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