On Nov 24, 2013, at 7:18 PM, Jeff Trawick <[email protected]> wrote:
> On Sat, Nov 23, 2013 at 5:39 PM, Yann Ylavic <[email protected]> wrote: > Couldn't ap_queue_info_try_get_idler() and the event_pre_config() check use : > > > prev_idlers = apr_atomic_add32((apr_uint32_t *)&(queue_info->idlers), -1); > > like ap_queue_info_wait_for_idler() does ? > > I think that's correct... > > What the code really wants is new_idlers, so edit that slightly to > > new_idlers = apr_atomic_add32((apr_uint32_t *)&(queue_info->idlers), -1) - 1; > if (new_idlers <= 0) { > ... > return APR_EAGAIN; > } It just wants to see if there are any idle ones... If there wasn't before the dec, then we need to return APR_EAGAIN. Recall that a 0 means "no idlers" and neg means 'this many blocking', and the logic is the same in both cases, minus the "wake up" scenario.
