Lines Matching defs:queue_info
66 apr_status_t ap_queue_info_create(fd_queue_info_t ** queue_info,
91 *queue_info = qi;
96 apr_status_t ap_queue_info_set_idle(fd_queue_info_t * queue_info,
101 ap_push_pool(queue_info, pool_to_recycle);
104 if (apr_atomic_inc32(&queue_info->idlers) < zero_pt) {
105 rv = apr_thread_mutex_lock(queue_info->idlers_mutex);
110 rv = apr_thread_cond_signal(queue_info->wait_for_idler);
112 apr_thread_mutex_unlock(queue_info->idlers_mutex);
115 rv = apr_thread_mutex_unlock(queue_info->idlers_mutex);
124 apr_status_t ap_queue_info_try_get_idler(fd_queue_info_t * queue_info)
132 if (apr_atomic_add32(&(queue_info->idlers), -1) <= zero_pt + 1) {
133 apr_atomic_inc32(&(queue_info->idlers)); /* back out dec */
139 apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t * queue_info,
148 if (apr_atomic_add32(&queue_info->idlers, -1) <= zero_pt) {
149 rv = apr_thread_mutex_lock(queue_info->idlers_mutex);
152 apr_atomic_inc32(&(queue_info->idlers)); /* back out dec */
163 * of queue_info->idlers above. It's possible
172 * queue_info->idlers tells how many
175 if (queue_info->idlers < zero_pt) {
177 rv = apr_thread_cond_wait(queue_info->wait_for_idler,
178 queue_info->idlers_mutex);
182 rv2 = apr_thread_mutex_unlock(queue_info->idlers_mutex);
189 rv = apr_thread_mutex_unlock(queue_info->idlers_mutex);
195 if (queue_info->terminated) {
203 apr_uint32_t ap_queue_info_get_idlers(fd_queue_info_t * queue_info)
206 val = apr_atomic_read32(&queue_info->idlers);
212 void ap_push_pool(fd_queue_info_t * queue_info,
217 * it into the queue_info's list of recycled pools
222 if (queue_info->max_recycled_pools >= 0) {
223 apr_uint32_t cnt = apr_atomic_read32(&queue_info->recycled_pools_count);
224 if (cnt >= queue_info->max_recycled_pools) {
228 apr_atomic_inc32(&queue_info->recycled_pools_count);
237 * Save queue_info->recycled_pool in local variable next because
241 struct recycled_pool *next = queue_info->recycled_pools;
243 if (apr_atomic_casptr((void*) &(queue_info->recycled_pools),
249 void ap_pop_pool(apr_pool_t ** recycled_pool, fd_queue_info_t * queue_info)
265 struct recycled_pool *first_pool = queue_info->recycled_pools;
270 ((void*) &(queue_info->recycled_pools),
273 if (queue_info->max_recycled_pools >= 0)
274 apr_atomic_dec32(&queue_info->recycled_pools_count);
280 apr_status_t ap_queue_info_term(fd_queue_info_t * queue_info)
283 rv = apr_thread_mutex_lock(queue_info->idlers_mutex);
287 queue_info->terminated = 1;
288 apr_thread_cond_broadcast(queue_info->wait_for_idler);
289 return apr_thread_mutex_unlock(queue_info->idlers_mutex);