248 |
|
* |
249 |
|
* </dl> |
250 |
|
* |
251 |
< |
* <p><b>Extension example</b>. Most extensions of this class |
251 |
> |
* <p><b>Extension example.</b> Most extensions of this class |
252 |
|
* override one or more of the protected hook methods. For example, |
253 |
|
* here is a subclass that adds a simple pause/resume feature: |
254 |
|
* |
1522 |
|
// As a heuristic, prestart enough new workers (up to new |
1523 |
|
// core size) to handle the current number of tasks in |
1524 |
|
// queue, but stop if queue becomes empty while doing so. |
1525 |
+ |
/* |
1526 |
|
int k = Math.min(delta, workQueue.size()); |
1527 |
|
while (k-- > 0 && addWorker(null, true)) { |
1528 |
|
if (workQueue.isEmpty()) |
1529 |
|
break; |
1530 |
|
} |
1531 |
+ |
*/ |
1532 |
|
} |
1533 |
|
} |
1534 |
|
|