From commits-return-12518-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Fri Apr 13 20:55:01 2012 Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 403909794 for ; Fri, 13 Apr 2012 20:55:01 +0000 (UTC) Received: (qmail 27790 invoked by uid 500); 13 Apr 2012 20:55:01 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 27723 invoked by uid 500); 13 Apr 2012 20:55:00 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 27706 invoked by uid 99); 13 Apr 2012 20:55:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2012 20:55:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2012 20:54:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 29F1A2388865 for ; Fri, 13 Apr 2012 20:54:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1325944 - in /apr/apr/trunk: configure.in include/apr_poll.h include/arch/unix/apr_arch_poll_private.h poll/unix/pollset.c poll/unix/z_asio.c Date: Fri, 13 Apr 2012 20:54:35 -0000 To: commits@apr.apache.org From: gregames@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120413205436.29F1A2388865@eris.apache.org> Author: gregames Date: Fri Apr 13 20:54:35 2012 New Revision: 1325944 URL: http://svn.apache.org/viewvc?rev=1325944&view=rev Log: z/OS "threadsafe" apr_pollset_poll depends on async i/o feeding an IPC message queue. Create a configure test for that combo and test it elsewhere. Modified: apr/apr/trunk/configure.in apr/apr/trunk/include/apr_poll.h apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h apr/apr/trunk/poll/unix/pollset.c apr/apr/trunk/poll/unix/z_asio.c Modified: apr/apr/trunk/configure.in URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=1325944&r1=1325943&r2=1325944&view=diff ============================================================================== --- apr/apr/trunk/configure.in (original) +++ apr/apr/trunk/configure.in Fri Apr 13 20:54:35 2012 @@ -885,6 +885,25 @@ if test "$apr_cv_epoll_create1" = "yes"; AC_DEFINE([HAVE_EPOLL_CREATE1], 1, [Define if epoll_create1 function is supported]) fi +# Check for z/OS async i/o support. +AC_CACHE_CHECK([for asio -> message queue support], [apr_cv_aio_msgq], +[AC_TRY_RUN([ +#define _AIO_OS390 +#include + +int main() +{ + struct aiocb a; + + a.aio_notifytype = AIO_MSGQ; /* use IPC message queue for notification */ + + return aio_cancel(2, NULL) == -1; +}], [apr_cv_aio_msgq=yes], [apr_cv_aio_msgq=no], [apr_cv_aio_msgq=no])]) + +if test "$apr_cv_aio_msgq" = "yes"; then + AC_DEFINE([HAVE_AIO_MSGQ], 1, [Define if async i/o supports message q's]) +fi + # test for dup3 AC_CACHE_CHECK([for dup3 support], [apr_cv_dup3], [AC_TRY_RUN([ Modified: apr/apr/trunk/include/apr_poll.h URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_poll.h?rev=1325944&r1=1325943&r2=1325944&view=diff ============================================================================== --- apr/apr/trunk/include/apr_poll.h (original) +++ apr/apr/trunk/include/apr_poll.h Fri Apr 13 20:54:35 2012 @@ -77,7 +77,7 @@ typedef enum { APR_POLLSET_KQUEUE, /**< Poll uses kqueue method */ APR_POLLSET_PORT, /**< Poll uses Solaris event port method */ APR_POLLSET_EPOLL, /**< Poll uses epoll method */ - APR_POLLSET_ASIO, /**< Poll uses z/OS async i/o method */ + APR_POLLSET_AIO_MSGQ, /**< Poll uses z/OS asio method */ APR_POLLSET_POLL /**< Poll uses poll method */ } apr_pollset_method_e; Modified: apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h?rev=1325944&r1=1325943&r2=1325944&view=diff ============================================================================== --- apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h (original) +++ apr/apr/trunk/include/arch/unix/apr_arch_poll_private.h Fri Apr 13 20:54:35 2012 @@ -45,9 +45,9 @@ #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif -#if defined(HAVE_AIO_H) && defined(__MVS__) -#define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ -#include /* aiocb */ +#if defined(HAVE_AIO_H) && defined(HAVE_AIO_MSGQ) +#define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ +#include /* aiocb */ #endif /* Choose the best method platform specific to use in apr_pollset */ @@ -60,9 +60,9 @@ #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL -#elif defined(HAVE_AIO_H) && defined(__MVS__) -#define POLLSET_USES_ASIO -#define POLLSET_DEFAULT_METHOD APR_POLLSET_ASIO +#elif defined(HAVE_AIO_MSGQ) +#define POLLSET_USES_AIO_MSGQ +#define POLLSET_DEFAULT_METHOD APR_POLLSET_AIO_MSGQ #elif defined(HAVE_POLL) #define POLLSET_USES_POLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL @@ -83,7 +83,7 @@ #endif #endif -#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_ASIO) +#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_AIO_MSGQ) #include "apr_ring.h" @@ -115,6 +115,7 @@ struct pfd_elem_t { 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; Modified: apr/apr/trunk/poll/unix/pollset.c URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/pollset.c?rev=1325944&r1=1325943&r2=1325944&view=diff ============================================================================== --- apr/apr/trunk/poll/unix/pollset.c (original) +++ apr/apr/trunk/poll/unix/pollset.c Fri Apr 13 20:54:35 2012 @@ -52,8 +52,8 @@ extern apr_pollset_provider_t *apr_polls #if defined(HAVE_EPOLL) extern apr_pollset_provider_t *apr_pollset_provider_epoll; #endif -#if defined(HAVE_AIO_H) && defined(__MVS__) -extern apr_pollset_provider_t *apr_pollset_provider_asio; +#if defined(HAVE_AIO_MSGQ) +extern apr_pollset_provider_t *apr_pollset_provider_aio_msgq; #endif #if defined(HAVE_POLL) extern apr_pollset_provider_t *apr_pollset_provider_poll; @@ -79,9 +79,9 @@ static apr_pollset_provider_t *pollset_p provider = apr_pollset_provider_epoll; #endif break; - case APR_POLLSET_ASIO: -#if defined(HAVE_AIO_H) && defined(__MVS__) - provider = apr_pollset_provider_asio; + case APR_POLLSET_AIO_MSGQ: +#if defined(HAVE_AIO_MSGQ) + provider = apr_pollset_provider_aio_msgq; #endif break; case APR_POLLSET_POLL: Modified: apr/apr/trunk/poll/unix/z_asio.c URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/z_asio.c?rev=1325944&r1=1325943&r2=1325944&view=diff ============================================================================== --- apr/apr/trunk/poll/unix/z_asio.c (original) +++ apr/apr/trunk/poll/unix/z_asio.c Fri Apr 13 20:54:35 2012 @@ -41,7 +41,7 @@ #include "apr_arch_networkio.h" #include "apr_arch_poll_private.h" -#if defined(HAVE_AIO_H) && defined(__MVS__) +#ifdef HAVE_AIO_MSGQ #include /* msgget etc */ #include /* timestruct */ @@ -736,6 +736,6 @@ static apr_pollset_provider_t impl = { "asio" }; -apr_pollset_provider_t *apr_pollset_provider_asio = &impl; +apr_pollset_provider_t *apr_pollset_provider_aio_msgq = &impl; -#endif /* HAVE_ASIO && __MVS__ */ +#endif /* HAVE_AIO_MSGQ */