273 |
|
|
274 |
|
private static int unarrivedOf(long s) { |
275 |
|
int counts = (int)s; |
276 |
< |
return (counts == EMPTY)? 0 : counts & UNARRIVED_MASK; |
276 |
> |
return (counts == EMPTY) ? 0 : counts & UNARRIVED_MASK; |
277 |
|
} |
278 |
|
|
279 |
|
private static int partiesOf(long s) { |
280 |
|
int counts = (int)s; |
281 |
< |
return (counts == EMPTY)? 0 : counts >>> PARTIES_SHIFT; |
281 |
> |
return (counts == EMPTY) ? 0 : counts >>> PARTIES_SHIFT; |
282 |
|
} |
283 |
|
|
284 |
|
private static int phaseOf(long s) { |
287 |
|
|
288 |
|
private static int arrivedOf(long s) { |
289 |
|
int counts = (int)s; |
290 |
< |
return (counts == EMPTY)? 0 : |
290 |
> |
return (counts == EMPTY) ? 0 : |
291 |
|
(counts >>> PARTIES_SHIFT) - (counts & UNARRIVED_MASK); |
292 |
|
} |
293 |
|
|
411 |
|
break; |
412 |
|
} |
413 |
|
else { |
414 |
< |
synchronized(this) { // 1st sub registration |
414 |
> |
synchronized (this) { // 1st sub registration |
415 |
|
if (state == s) { // recheck under lock |
416 |
|
par.doRegister(1); |
417 |
|
do { // force current phase |
524 |
|
this.evenQ = new AtomicReference<QNode>(); |
525 |
|
this.oddQ = new AtomicReference<QNode>(); |
526 |
|
} |
527 |
< |
this.state = (parties == 0)? ((long) EMPTY) : |
527 |
> |
this.state = (parties == 0) ? ((long) EMPTY) : |
528 |
|
((((long) phase) << PHASE_SHIFT) | |
529 |
|
(((long) parties) << PARTIES_SHIFT) | |
530 |
|
((long) parties)); |