Javadoc
Scans for and, if found, runs one task, else possibly
inactivates the worker. This method operates on single reads of
volatile state and is designed to be re-invoked continuously,
in part because it returns upon detecting inconsistencies,
contention, or state changes that indicate possible success on
re-invocation.
The scan searches for tasks across queues starting at a random
index, checking each at least twice. The scan terminates upon
either finding a non-empty queue, or completing the sweep. If
the worker is not inactivated, it takes and runs a task from
this queue. Otherwise, if not activated, it tries to activate
itself or some other worker by signalling. On failure to find a
task, returns (for retry) if pool state may have changed during
an empty scan, or tries to inactivate if active, else possibly
blocks or terminates via method awaitWork.