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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include "apr_pools.h"
22 #include "apr_thread_pool.h"
23 #include "apr_buckets.h"
26 #ifndef APACHE_MPM_SIMPLE_TYPES_H
27 #define APACHE_MPM_SIMPLE_TYPES_H
29 typedef struct simple_core_t simple_core_t;
35 int max_requests_per_child;
38 #define SIMPLE_MAX_PROC (500000)
39 #define SIMPLE_DEF_PROC (5)
40 #define SIMPLE_MIN_PROC (1)
41 #define SIMPLE_MAX_THREADS (500000)
42 #define SIMPLE_DEF_THREADS (5)
43 #define SIMPLE_MIN_THREADS (1)
45 typedef void (*simple_timer_cb) (simple_core_t * sc, void *baton);
46 typedef void (*simple_io_sock_cb) (simple_core_t * sc, apr_socket_t * sock,
47 int flags, void *baton);
48 typedef void (*simple_io_file_cb) (simple_core_t * sc, apr_socket_t * sock,
49 int flags, void *baton);
51 typedef struct simple_sb_t simple_sb_t;
55 SIMPLE_PT_CORE_ACCEPT,
57 /* pqXXXXXX: User IO not defined yet. */
65 } simple_spawn_type_e;
69 simple_poll_type_e type;
73 typedef struct simple_timer_t simple_timer_t;
76 APR_RING_ENTRY(simple_timer_t) link;
84 typedef struct simple_child_t simple_child_t;
87 /* TODO: More is needed here. */
94 apr_thread_mutex_t *mtx;
99 int run_single_process;
101 simple_spawn_type_e spawn_via;
103 simple_proc_mgr_t procmgr;
105 /* PID -> simple_child_t map */
106 apr_hash_t *children;
108 apr_pollcb_t *pollcb;
110 /* List of upcoming timers, sorted by nearest first.
112 APR_RING_HEAD(simple_timer_ring_t, simple_timer_t) timer_ring;
114 apr_thread_pool_t *workers;
117 typedef struct simple_conn_t simple_conn_t;
123 apr_bucket_alloc_t *ba;
125 /** poll file descriptor information */
127 /** public parts of the connection state */
131 simple_core_t *simple_core_get(void);
133 /* Allocates/initializes data retained over the life of the process */
134 apr_status_t simple_core_init_once(void);
136 #endif /* APACHE_MPM_SIMPLE_TYPES_H */