MCPcopy Create free account
hub / github.com/apache/httpd / ap_queue_push_socket

Function ap_queue_push_socket

server/mpm_fdqueue.c:382–407  ·  view source on GitHub ↗

* Push a new socket onto the queue. * * precondition: ap_queue_info_wait_for_idler has already been called * to reserve an idle worker thread */

Source from the content-addressed store, hash-verified

380 * to reserve an idle worker thread
381 */
382apr_status_t ap_queue_push_socket(fd_queue_t *queue,
383 apr_socket_t *sd, void *sd_baton,
384 apr_pool_t *p)
385{
386 fd_queue_elem_t *elem;
387 apr_status_t rv;
388
389 if ((rv = apr_thread_mutex_lock(queue->one_big_mutex)) != APR_SUCCESS) {
390 return rv;
391 }
392
393 AP_DEBUG_ASSERT(!queue->terminated);
394 AP_DEBUG_ASSERT(!ap_queue_full(queue));
395
396 elem = &queue->data[queue->in++];
397 if (queue->in >= queue->bounds)
398 queue->in -= queue->bounds;
399 elem->sd = sd;
400 elem->sd_baton = sd_baton;
401 elem->p = p;
402 queue->nelts++;
403
404 apr_thread_cond_signal(queue->not_empty);
405
406 return apr_thread_mutex_unlock(queue->one_big_mutex);
407}
408
409apr_status_t ap_queue_push_timer(fd_queue_t *queue, timer_event_t *te)
410{

Callers 2

listener_threadFunction · 0.85
push2workerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected