Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fdqueue.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
25 #ifndef FDQUEUE_H
26 #define FDQUEUE_H
27 #include "httpd.h"
28 #include <stdlib.h>
29 #if APR_HAVE_UNISTD_H
30 #include <unistd.h>
31 #endif
32 #include <apr_thread_mutex.h>
33 #include <apr_thread_cond.h>
34 #include <sys/types.h>
35 #if APR_HAVE_SYS_SOCKET_H
36 #include <sys/socket.h>
37 #endif
38 #include <apr_errno.h>
39 
40 #include "ap_mpm.h"
41 
44 
46  apr_pool_t * pool, int max_idlers,
47  int max_recycled_pools);
49  apr_pool_t * pool_to_recycle);
52  int *had_to_block);
55 void ap_free_idle_pools(fd_queue_info_t *queue_info);
56 
58 {
62 };
64 
66 
68 {
72  void *baton;
73  int canceled;
75 };
76 
77 struct fd_queue_t
78 {
79  APR_RING_HEAD(timers_t, timer_event_t) timers;
81  unsigned int nelts;
82  unsigned int bounds;
83  unsigned int in;
84  unsigned int out;
88 };
89 typedef struct fd_queue_t fd_queue_t;
90 
91 void ap_pop_pool(apr_pool_t ** recycled_pool, fd_queue_info_t * queue_info);
92 void ap_push_pool(fd_queue_info_t * queue_info,
93  apr_pool_t * pool_to_recycle);
94 
95 apr_status_t ap_queue_init(fd_queue_t * queue, int queue_capacity,
96  apr_pool_t * a);
101  event_conn_state_t ** ecs, apr_pool_t ** p,
102  timer_event_t ** te);
106 
107 #endif /* FDQUEUE_H */
108 
void * baton
Definition: fdqueue.h:72
apr_status_t ap_queue_interrupt_all(fd_queue_t *queue)
apr_uint32_t ap_queue_info_get_idlers(fd_queue_info_t *queue_info)
apr_status_t ap_queue_init(fd_queue_t *queue, int queue_capacity, apr_pool_t *a)
void( ap_mpm_callback_fn_t)(void *baton)
Definition: ap_mpm.h:208
Definition: apr_arch_thread_mutex.h:28
apr_thread_cond_t * not_empty
Definition: fdqueue.h:86
Definition: apr_tables.h:62
int terminated
Definition: fdqueue.h:87
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:556
apr_status_t ap_queue_info_term(fd_queue_info_t *queue_info)
void ap_pop_pool(apr_pool_t **recycled_pool, fd_queue_info_t *queue_info)
struct event_conn_state_t event_conn_state_t
Definition: fdqueue.h:43
apr_status_t ap_queue_push_timer(fd_queue_t *queue, timer_event_t *te)
void ap_push_pool(fd_queue_info_t *queue_info, apr_pool_t *pool_to_recycle)
apr_status_t ap_queue_info_set_idle(fd_queue_info_t *queue_info, apr_pool_t *pool_to_recycle)
Definition: fdqueue.h:77
APR Thread Mutex Routines.
Definition: fdqueue.h:67
apr_status_t ap_queue_term(fd_queue_t *queue)
apr_time_t when
Definition: fdqueue.h:70
fd_queue_elem_t * data
Definition: fdqueue.h:80
APR_RING_ENTRY(timer_event_t) link
apr_thread_mutex_t * one_big_mutex
Definition: fdqueue.h:85
ap_mpm_callback_fn_t * cbfunc
Definition: fdqueue.h:71
apr_int64_t apr_time_t
Definition: apr_time.h:45
HTTP Daemon routines.
unsigned int out
Definition: fdqueue.h:84
Definition: apr_arch_networkio.h:37
void ap_free_idle_pools(fd_queue_info_t *queue_info)
apr_status_t ap_queue_push(fd_queue_t *queue, apr_socket_t *sd, event_conn_state_t *ecs, apr_pool_t *p)
apr_pool_t * p
Definition: fdqueue.h:60
APR Error Codes.
Definition: fdqueue.h:57
apr_status_t ap_queue_interrupt_one(fd_queue_t *queue)
unsigned int apr_uint32_t
Definition: apr.h:334
int canceled
Definition: fdqueue.h:73
APR Condition Variable Routines.
unsigned int in
Definition: fdqueue.h:83
apr_pool_t * p
unsigned int nelts
Definition: fdqueue.h:81
apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t *queue_info, int *had_to_block)
Apache Multi-Processing Module library.
unsigned int bounds
Definition: fdqueue.h:82
struct fd_queue_info_t fd_queue_info_t
Definition: fdqueue.h:42
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
apr_status_t ap_queue_pop_something(fd_queue_t *queue, apr_socket_t **sd, event_conn_state_t **ecs, apr_pool_t **p, timer_event_t **te)
Definition: apr_arch_thread_cond.h:34
apr_status_t ap_queue_info_create(fd_queue_info_t **queue_info, apr_pool_t *pool, int max_idlers, int max_recycled_pools)
event_conn_state_t * ecs
Definition: fdqueue.h:61
APR_RING_HEAD(timers_t, timer_event_t) timers
apr_socket_t * sd
Definition: fdqueue.h:59
apr_status_t ap_queue_info_try_get_idler(fd_queue_info_t *queue_info)