1070 |
|
} |
1071 |
|
} |
1072 |
|
|
1073 |
< |
// Creating, registering and deregistring workers |
1073 |
> |
// Creating, registering and deregistering workers |
1074 |
|
|
1075 |
|
/** |
1076 |
|
* Tries to create and start a worker; minimally rolls back counts |
1341 |
|
* @param delta 1 for increment, -1 for decrement |
1342 |
|
*/ |
1343 |
|
final void addActiveCount(int delta) { |
1344 |
< |
long d = delta < 0 ? -AC_UNIT : AC_UNIT; |
1344 |
> |
long d = (long)delta << AC_SHIFT; |
1345 |
|
long c; |
1346 |
< |
do {} while (!UNSAFE.compareAndSwapLong(this, ctlOffset, c = ctl, |
1347 |
< |
((c + d) & AC_MASK) | |
1348 |
< |
(c & ~AC_MASK))); |
1346 |
> |
do {} while (!UNSAFE.compareAndSwapLong(this, ctlOffset, |
1347 |
> |
c = ctl, c + d)); |
1348 |
|
} |
1349 |
|
|
1350 |
|
/** |