330 |
|
/** |
331 |
|
* Lifecycle state |
332 |
|
*/ |
333 |
< |
private volatile int runState; |
333 |
> |
volatile int runState; |
334 |
|
|
335 |
|
// Special values for runState |
336 |
|
/** Normal, not-shutdown mode */ |
337 |
< |
private static final int RUNNING = 0; |
337 |
> |
static final int RUNNING = 0; |
338 |
|
/** Controlled shutdown mode */ |
339 |
< |
private static final int SHUTDOWN = 1; |
339 |
> |
static final int SHUTDOWN = 1; |
340 |
|
/** Immediate shutdown mode */ |
341 |
< |
private static final int STOP = 2; |
341 |
> |
static final int STOP = 2; |
342 |
|
/** Final state */ |
343 |
< |
private static final int TERMINATED = 3; |
343 |
> |
static final int TERMINATED = 3; |
344 |
|
|
345 |
|
/** |
346 |
|
* Handler called when saturated or shutdown in execute. |
452 |
|
* @return the task |
453 |
|
* @throws InterruptedException if interrupted while waiting for task |
454 |
|
*/ |
455 |
< |
private Runnable getTask() throws InterruptedException { |
455 |
> |
Runnable getTask() throws InterruptedException { |
456 |
|
for (;;) { |
457 |
|
switch(runState) { |
458 |
|
case RUNNING: { |
517 |
|
* Perform bookkeeping for a terminated worker thread. |
518 |
|
* @param w the worker |
519 |
|
*/ |
520 |
< |
private void workerDone(Worker w) { |
520 |
> |
void workerDone(Worker w) { |
521 |
|
final ReentrantLock mainLock = this.mainLock; |
522 |
|
mainLock.lock(); |
523 |
|
try { |