On Wed, May 29, 2013 at 11:29 PM, Benson Margulies <bimargul...@gmail.com>wrote:

> The comment here is clearly wrong, since there is no division by two.
>
> I think that the code is wrong, because this results in not starting
> runners when it should start runners. Am I misanalyzing?
>
> if (runners.isEmpty() || (queue.remainingCapacity() < queue.size() // queue
>
>       // is
>
>       // half
>
>       // full
>
>       // and
>
>       // we
>
>       // can
>
>       // add
>
>       // more
>
>       // runners
>               && runners.size() < threadCount)) {
>


queue.remainingCapacity() returns capacity - queue.size() so the comment is
correct.

-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to