apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr/locks/unix thread_rwlock.c
Date Tue, 27 Jan 2004 09:59:38 GMT
jorton      2004/01/27 01:59:38

  Modified:    .        Tag: APR_0_9_BRANCH configure.in
               include/arch/unix Tag: APR_0_9_BRANCH
                        apr_arch_thread_rwlock.h
               locks/unix Tag: APR_0_9_BRANCH thread_rwlock.c
  Log:
  Backport from HEAD:
  
  * configure.in: Fix detection of pthread rwlocks to actually fail when
  pthread_rwlock_t can't be used; print and cache results of tests
  carried out; define HAVE_PTHREAD_RWLOCKS when rwlocks can be used.
  
  * locks/unix/thread_rwlock.c, include/arch/unix/apr_arch_thread_rwlock.h:
  Use new HAVE_PTHREAD_RWLOCKS define.
  
  PR: 22990
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.535.2.3 +12 -12    apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.535.2.2
  retrieving revision 1.535.2.3
  diff -b -d -u -r1.535.2.2 -r1.535.2.3
  --- configure.in	15 Nov 2003 23:42:33 -0000	1.535.2.2
  +++ configure.in	27 Jan 2004 09:59:31 -0000	1.535.2.3
  @@ -526,22 +526,22 @@
               dnl Linux is silly as it has pthread_rwlock_init defined
               dnl but keeps the pthread_rwlock_t structure hidden unless 
               dnl special things are defined.
  +            AC_CACHE_CHECK([for pthread_rwlock_t], [apr_cv_type_rwlock_t],
               AC_TRY_COMPILE([#include <sys/types.h>
  -#include <pthread.h>], 
  -                [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
  -                 ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
  -            if test "$ac_cv_struct_pthread_rw" = "no"; then
  -                AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
  +#include <pthread.h>], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
  +              [apr_cv_type_rwlock_t=yes],
  +              [AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
   #define _BSD_SOURCE
   #define _SVID_SOURCE
   #include <sys/types.h>
  -#include <pthread.h>], 
  -                    [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
  -                    ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no)
  -                if test "$ac_cv_struct_pthread_rw" = "yes"; then
  -                    APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE])
  -                    APR_ADDTO(CPPFLAGS, [-D_SVID_SOURCE])
  -                fi
  +#include <pthread.h>], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
  +              [apr_cv_type_rwlock_t=yes-with-XOPEN_SOURCE], [apr_cv_type_rwlock_t=no])],
  +              [apr_cv_type_rwlock_t=no]))
  +            case $apr_cv_type_rwlock_t in
  +            yes*) AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available])
;;
  +            esac
  +            if test "$apr_cv_type_rwlock_t" = "yes-with-XOPEN_SOURCE"; then
  +               APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE])
               fi
           fi
       fi
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +1 -1      apr/include/arch/unix/apr_arch_thread_rwlock.h
  
  Index: apr_arch_thread_rwlock.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/apr_arch_thread_rwlock.h,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -b -d -u -r1.1.2.1 -r1.1.2.2
  --- apr_arch_thread_rwlock.h	25 Jan 2004 16:36:49 -0000	1.1.2.1
  +++ apr_arch_thread_rwlock.h	27 Jan 2004 09:59:38 -0000	1.1.2.2
  @@ -67,7 +67,7 @@
   #endif
   
   #if APR_HAS_THREADS
  -#ifdef HAVE_PTHREAD_RWLOCK_INIT
  +#ifdef HAVE_PTHREAD_RWLOCKS
   
   struct apr_thread_rwlock_t {
       apr_pool_t *pool;
  
  
  
  No                   revision
  No                   revision
  1.8.2.1   +4 -4      apr/locks/unix/thread_rwlock.c
  
  Index: thread_rwlock.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/thread_rwlock.c,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -b -d -u -r1.8 -r1.8.2.1
  --- thread_rwlock.c	6 Jan 2003 23:44:31 -0000	1.8
  +++ thread_rwlock.c	27 Jan 2004 09:59:38 -0000	1.8.2.1
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -57,7 +57,7 @@
   
   #if APR_HAS_THREADS
   
  -#ifdef HAVE_PTHREAD_RWLOCK_INIT
  +#ifdef HAVE_PTHREAD_RWLOCKS
   
   static apr_status_t thread_rwlock_cleanup(void *data)
   {
  @@ -192,7 +192,7 @@
       return stat;
   }
   
  -#else  /* HAVE_PTHREAD_RWLOCK_INIT */
  +#else  /* HAVE_PTHREAD_RWLOCKS */
   
   APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock,
                                                      apr_pool_t *pool)
  @@ -230,7 +230,7 @@
       return APR_ENOTIMPL;
   }
   
  -#endif /* HAVE_PTHREAD_RWLOCK_INIT */
  +#endif /* HAVE_PTHREAD_RWLOCKS */
   APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock)
   
   #endif /* APR_HAS_THREADS */
  
  
  

Mime
View raw message