346 |
|
* "while ((local = field) != 0)") which are usually the simplest |
347 |
|
* way to ensure the required read orderings (which are sometimes |
348 |
|
* critical). Also several occurrences of the unusual "do {} |
349 |
< |
* while(!cas...)" which is the simplest way to force an update of |
349 |
> |
* while (!cas...)" which is the simplest way to force an update of |
350 |
|
* a CAS'ed variable. There are also other coding oddities that |
351 |
|
* help some methods perform reasonably even when interpreted (not |
352 |
|
* compiled), at the expense of some messy constructions that |
832 |
|
UNSAFE.compareAndSwapInt(this, spareWaitersOffset, |
833 |
|
sw, w.nextSpare)) { |
834 |
|
int c; // increment running count before resume |
835 |
< |
do {} while(!UNSAFE.compareAndSwapInt |
836 |
< |
(this, workerCountsOffset, |
837 |
< |
c = workerCounts, c + ONE_RUNNING)); |
835 |
> |
do {} while (!UNSAFE.compareAndSwapInt |
836 |
> |
(this, workerCountsOffset, |
837 |
> |
c = workerCounts, c + ONE_RUNNING)); |
838 |
|
if (w.tryUnsuspend()) |
839 |
|
LockSupport.unpark(w); |
840 |
|
else // back out if w was shutdown |
1721 |
|
throws InterruptedException { |
1722 |
|
try { |
1723 |
|
return termination.awaitAdvanceInterruptibly(0, timeout, unit) > 0; |
1724 |
< |
} catch(TimeoutException ex) { |
1724 |
> |
} catch (TimeoutException ex) { |
1725 |
|
return false; |
1726 |
|
} |
1727 |
|
} |