diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:42:53 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:42:53 +0100 |
commit | db26b587c04799e75b6dd0fcd4b46aaa168f9161 (patch) | |
tree | 127af2f77fd3eddb75604ebecedeeea163325078 /srclib/apr/include/arch | |
parent | d9f98b967bedecc0bffe82682d1ed4e06c9df687 (diff) | |
download | apache2-db26b587c04799e75b6dd0fcd4b46aaa168f9161.tar.gz |
Upstream tarball 2.2.15upstream/2.2.15
Diffstat (limited to 'srclib/apr/include/arch')
-rw-r--r-- | srclib/apr/include/arch/unix/apr_arch_poll_private.h | 86 | ||||
-rw-r--r-- | srclib/apr/include/arch/unix/apr_private.h.in | 36 |
2 files changed, 98 insertions, 24 deletions
diff --git a/srclib/apr/include/arch/unix/apr_arch_poll_private.h b/srclib/apr/include/arch/unix/apr_arch_poll_private.h index f176eac0..a2673049 100644 --- a/srclib/apr/include/arch/unix/apr_arch_poll_private.h +++ b/srclib/apr/include/arch/unix/apr_arch_poll_private.h @@ -17,13 +17,6 @@ #ifndef APR_ARCH_POLL_PRIVATE_H #define APR_ARCH_POLL_PRIVATE_H -#include "apr.h" -#include "apr_poll.h" -#include "apr_time.h" -#include "apr_portable.h" -#include "apr_arch_networkio.h" -#include "apr_arch_file_io.h" - #if HAVE_POLL_H #include <poll.h> #endif @@ -55,21 +48,32 @@ /* Choose the best method platform specific to use in apr_pollset */ #ifdef HAVE_KQUEUE #define POLLSET_USES_KQUEUE +#define POLLSET_DEFAULT_METHOD APR_POLLSET_KQUEUE #elif defined(HAVE_PORT_CREATE) #define POLLSET_USES_PORT +#define POLLSET_DEFAULT_METHOD APR_POLLSET_PORT #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL +#define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL #elif defined(HAVE_POLL) #define POLLSET_USES_POLL +#define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL #else #define POLLSET_USES_SELECT +#define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT #endif +#ifdef WIN32 +#define POLL_USES_SELECT +#undef POLLSET_DEFAULT_METHOD +#define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT +#else #ifdef HAVE_POLL #define POLL_USES_POLL #else #define POLL_USES_SELECT #endif +#endif #if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) @@ -79,10 +83,10 @@ #include "apr_thread_mutex.h" #define pollset_lock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ - apr_thread_mutex_lock(pollset->ring_lock); + apr_thread_mutex_lock(pollset->p->ring_lock); #define pollset_unlock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ - apr_thread_mutex_unlock(pollset->ring_lock); + apr_thread_mutex_unlock(pollset->p->ring_lock); #else #define pollset_lock_rings() #define pollset_unlock_rings() @@ -93,8 +97,72 @@ typedef struct pfd_elem_t pfd_elem_t; struct pfd_elem_t { APR_RING_ENTRY(pfd_elem_t) link; apr_pollfd_t pfd; +#ifdef HAVE_PORT_CREATE + int on_query_ring; +#endif +}; + +#endif + +typedef struct apr_pollset_private_t apr_pollset_private_t; +typedef struct apr_pollset_provider_t apr_pollset_provider_t; +typedef struct apr_pollcb_provider_t apr_pollcb_provider_t; +struct apr_pollset_t +{ + apr_pool_t *pool; + apr_uint32_t nelts; + apr_uint32_t nalloc; + apr_uint32_t flags; + /* Pipe descriptors used for wakeup */ + apr_file_t *wakeup_pipe[2]; + apr_pollset_private_t *p; + apr_pollset_provider_t *provider; }; +typedef union { +#if defined(HAVE_EPOLL) + struct epoll_event *epoll; #endif +#if defined(HAVE_PORT_CREATE) + port_event_t *port; +#endif +#if defined(HAVE_KQUEUE) + struct kevent *ke; +#endif +#if defined(HAVE_POLL) + struct pollfd *ps; +#endif + void *undef; +} apr_pollcb_pset; + +struct apr_pollcb_t { + apr_pool_t *pool; + apr_uint32_t nelts; + apr_uint32_t nalloc; + int fd; + apr_pollcb_pset pollset; + apr_pollfd_t **copyset; + apr_pollcb_provider_t *provider; +}; + +struct apr_pollset_provider_t { + apr_status_t (*create)(apr_pollset_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t); + apr_status_t (*add)(apr_pollset_t *, const apr_pollfd_t *); + apr_status_t (*remove)(apr_pollset_t *, const apr_pollfd_t *); + apr_status_t (*poll)(apr_pollset_t *, apr_interval_time_t, apr_int32_t *, const apr_pollfd_t **); + apr_status_t (*cleanup)(apr_pollset_t *); + const char *name; +}; + +struct apr_pollcb_provider_t { + apr_status_t (*create)(apr_pollcb_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t); + apr_status_t (*add)(apr_pollcb_t *, apr_pollfd_t *); + apr_status_t (*remove)(apr_pollcb_t *, apr_pollfd_t *); + apr_status_t (*poll)(apr_pollcb_t *, apr_interval_time_t, apr_pollcb_cb_t, void *); + const char *name; +}; + +/* Private functions */ +void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset); #endif /* APR_ARCH_POLL_PRIVATE_H */ diff --git a/srclib/apr/include/arch/unix/apr_private.h.in b/srclib/apr/include/arch/unix/apr_private.h.in index c42ec09e..bc232cfd 100644 --- a/srclib/apr/include/arch/unix/apr_private.h.in +++ b/srclib/apr/include/arch/unix/apr_private.h.in @@ -1,5 +1,10 @@ /* include/arch/unix/apr_private.h.in. Generated from configure.in by autoheader. */ + +#ifndef APR_PRIVATE_H +#define APR_PRIVATE_H + + /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD @@ -146,6 +151,9 @@ /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `fdatasync' function. */ +#undef HAVE_FDATASYNC + /* Define to 1 if you have the `flock' function. */ #undef HAVE_FLOCK @@ -527,40 +535,40 @@ /* Define if struct impreq was found */ #undef HAVE_STRUCT_IPMREQ -/* Define to 1 if `struct stat' is a member of `st_atimensec'. */ +/* Define to 1 if `st_atimensec' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATIMENSEC -/* Define to 1 if `struct stat' is a member of `st_atime_n'. */ +/* Define to 1 if `st_atime_n' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATIME_N -/* Define to 1 if `struct stat' is a member of `st_atim.tv_nsec'. */ +/* Define to 1 if `st_atim.tv_nsec' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC -/* Define to 1 if `struct stat' is a member of `st_blocks'. */ +/* Define to 1 if `st_blocks' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS -/* Define to 1 if `struct stat' is a member of `st_ctimensec'. */ +/* Define to 1 if `st_ctimensec' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_CTIMENSEC -/* Define to 1 if `struct stat' is a member of `st_ctime_n'. */ +/* Define to 1 if `st_ctime_n' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_CTIME_N -/* Define to 1 if `struct stat' is a member of `st_ctim.tv_nsec'. */ +/* Define to 1 if `st_ctim.tv_nsec' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC -/* Define to 1 if `struct stat' is a member of `st_mtimensec'. */ +/* Define to 1 if `st_mtimensec' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIMENSEC -/* Define to 1 if `struct stat' is a member of `st_mtime_n'. */ +/* Define to 1 if `st_mtime_n' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIME_N -/* Define to 1 if `struct stat' is a member of `st_mtim.tv_nsec'. */ +/* Define to 1 if `st_mtim.tv_nsec' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC -/* Define to 1 if `struct tm' is a member of `tm_gmtoff'. */ +/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF -/* Define to 1 if `struct tm' is a member of `__tm_gmtoff'. */ +/* Define to 1 if `__tm_gmtoff' is member of `struct tm'. */ #undef HAVE_STRUCT_TM___TM_GMTOFF /* Define to 1 if you have the <sysapi.h> header file. */ @@ -725,9 +733,6 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -939,4 +944,5 @@ * Include common private declarations. */ #include "../apr_private_common.h" +#endif /* APR_PRIVATE_H */ |