Apache HTTPD
mpm_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 MPM_FDQUEUE_H
26#define MPM_FDQUEUE_H
27
28#include <apr.h>
29
30/* This code is not AP_DECLARE()ed/exported, and used by MPMs event/worker
31 * only (for now), not worth thinking about w/o threads either...
32 */
33#if APR_HAS_THREADS
34
35#include "ap_mpm.h"
36
37#include <apr_ring.h>
38#include <apr_pools.h>
39#include <apr_thread_mutex.h>
40#include <apr_thread_cond.h>
41#include <apr_network_io.h>
42
43struct fd_queue_info_t; /* opaque */
44struct fd_queue_elem_t; /* opaque */
45typedef struct fd_queue_info_t fd_queue_info_t;
46typedef struct fd_queue_elem_t fd_queue_elem_t;
47
55 int *had_to_block);
58
64
65struct timer_event_t
66{
70 void *baton;
71 int canceled;
72 apr_array_header_t *remove;
73};
74typedef struct timer_event_t timer_event_t;
75
76struct fd_queue_t
77{
80 unsigned int nelts;
81 unsigned int bounds;
82 unsigned int in;
83 unsigned int out;
85 apr_thread_cond_t *not_empty;
86 volatile int terminated;
87};
88typedef struct fd_queue_t fd_queue_t;
89
91 int capacity, apr_pool_t *p);
93 apr_socket_t *sd, void *sd_baton,
94 apr_pool_t *p);
98 apr_socket_t **sd, void **sd_baton,
100#define ap_queue_pop_socket(q_, s_, p_) \
101 ap_queue_pop_something((q_), (s_), NULL, (p_), NULL)
102
106
107#endif /* APR_HAS_THREADS */
108
109#endif /* MPM_FDQUEUE_H */
#define AP_DECLARE(type)
Definition ap_config.h:67
Apache Multi-Processing Module library.
APR Network library.
APR memory allocation.
APR Rings.
APR Condition Variable Routines.
APR Thread Mutex Routines.
void() ap_mpm_callback_fn_t(void *baton)
Definition ap_mpm.h:198
ap_vhost_iterate_conn_cb void * baton
Definition http_vhost.h:87
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
void * data
#define APR_RING_ENTRY(elem)
Definition apr_ring.h:70
#define APR_RING_HEAD(head, elem)
Definition apr_ring.h:91
int nelts
Definition apr_tables.h:122
apr_int32_t in
apr_int64_t apr_time_t
Definition apr_time.h:45
apr_pool_t * p
Definition md_event.c:32
static apr_file_t * out
Definition mod_info.c:85