cvs commit: apache-2.0/src/lib/apr/threadproc/unix thread.c

1999-12-06 Thread rbb
rbb 99/12/06 07:47:46

  Modified:src/lib/apr acconfig.h configure.in
   src/lib/apr/include apr.h.in apr_network_io.h
   src/lib/apr/lib apr_pools.c
   src/lib/apr/threadproc/unix thread.c
  Log:
  Cleanup some mistakes I made.  We are now configuring the APR_HAS_FOO
  macros in a cleaner way IMO, and that required that we always use #if
  instead of #ifdef.  I also used the wrong #if HAVE_SIGNAL_H macro
  in apr_pools.c.
  Submitted by:  David Reid
  
  Revision  ChangesPath
  1.16  +0 -2  apache-2.0/src/lib/apr/acconfig.h
  
  Index: acconfig.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/acconfig.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- acconfig.h1999/12/04 21:48:30 1.15
  +++ acconfig.h1999/12/06 15:47:42 1.16
  @@ -45,8 +45,6 @@
   #undef USEBCOPY
   
   #undef SIZEOF_SSIZE_T
  -#undef APR_HAS_THREADS
  -#undef APR_HAS_SENDFILE
   
   @BOTTOM@
   
  
  
  
  1.32  +8 -8  apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- configure.in  1999/12/04 21:48:31 1.31
  +++ configure.in  1999/12/06 15:47:42 1.32
  @@ -238,10 +238,10 @@
   AC_FUNC_SETPGRP
   
   if test $ac_cv_func_mmap_fixed_mapped = yes; then 
  -mmap=#define APR_HAS_MMAP 1
  +mmap=1
   AC_SUBST(mmap)
   else
  -mmap=#define APR_HAS_MMAP 0
  +mmap=0
   AC_SUBST(mmap)
   fi
   
  @@ -262,7 +262,7 @@
   AC_CHECK_FUNCS(pthread_sigmask)
   AC_CHECK_FUNCS(strcasecmp stricmp poll setsid)
   AC_CHECK_FUNCS(sigaction writev)
  -AC_CHECK_FUNCS(sendfile, [ sendfile=#define APR_HAS_SENDFILE 1 ], [ 
sendfile=APR_HAS_SENDFILE 0 ]) 
  +AC_CHECK_FUNCS(sendfile, [ sendfile=1 ], [ sendfile=0 ]) 
   AC_CHECK_FUNCS(getpass)
   AC_CHECK_FUNC(_getch)
   AC_SUBST(sendfile)
  @@ -274,7 +274,7 @@
   [  --enable-threads  Enable threading support in APR.],
   [
 if test $enableval = no; then 
  -threads=#define APR_HAS_THREADS 0
  +threads=0
   pthreadh=0
   AC_SUBST(threads)
   AC_SUBST(pthreadh)
  @@ -282,11 +282,11 @@
 else
   if test $enableval = pthread; then
 AC_CHECK_HEADERS(pthread.h, [ 
  -  threads=#define APR_HAS_THREADS 1
  +  threads=1
 pthreadh=1
 AC_SUBST(pthreadh)
 AC_SUBST(threads) ], [
  -  threads=#define APR_HAS_THREADS 0
  +  threads=0
 pthreadh=0
 AC_SUBST(pthreadh)
 AC_SUBST(threads) ] )
  @@ -298,11 +298,11 @@
   ],
   [
 AC_CHECK_HEADERS(pthread.h, [
  -  threads=#define APR_HAS_THREADS 1
  +  threads=1
 pthreadh=1
 AC_SUBST(pthreadh)
 AC_SUBST(threads) ], [
  -  threads=#define APR_HAS_THREADS 0
  +  threads=0
 pthreadh=0
 AC_SUBST(pthreadh)
 AC_SUBST(threads) ] )
  
  
  
  1.5   +3 -3  apache-2.0/src/lib/apr/include/apr.h.in
  
  Index: apr.h.in
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- apr.h.in  1999/12/04 21:48:33 1.4
  +++ apr.h.in  1999/12/06 15:47:43 1.5
  @@ -17,9 +17,9 @@
   #endif
   
   /*  APR Feature Macros */
  [EMAIL PROTECTED]@
  [EMAIL PROTECTED]@
  [EMAIL PROTECTED]@
  +#define APR_HAS_THREADS  @threads@
  +#define APR_HAS_SENDFILE @sendfile@
  +#define APR_HAS_MMAP @mmap@
   
   /* Typedefs that APR needs. */
   
  
  
  
  1.19  +1 -1  apache-2.0/src/lib/apr/include/apr_network_io.h
  
  Index: apr_network_io.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- apr_network_io.h  1999/12/04 21:48:33 1.18
  +++ apr_network_io.h  1999/12/06 15:47:43 1.19
  @@ -106,7 +106,7 @@
   typedef struct pollfd_tap_pollfd_t;
   typedef struct hdtr_tap_hdtr_t;
   
  -#ifdef APR_HAS_SENDFILE
  +#if APR_HAS_SENDFILE
   /* A structure to encapsulate headers and trailers for ap_sendfile */
   struct hdtr_t {
   struct iovec* headers;
  
  
  
  1.26  +3 -0  apache-2.0/src/lib/apr/lib/apr_pools.c
  
  Index: apr_pools.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/lib/apr_pools.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- apr_pools.c   1999/12/02 17:05:40 1.25
  +++ apr_pools.c   1999/12/06 15:47:45  

cvs commit: apache-2.0/src/lib/apr/threadproc/unix thread.c threadcancel.c threadpriv.c threadproc.h

1999-10-21 Thread rbb
rbb 99/10/21 07:31:29

  Modified:src/lib/apr/include apr_portable.h
   src/lib/apr/locks/unix intraproc.c locks.c locks.h
   src/lib/apr/threadproc/unix thread.c threadcancel.c
threadpriv.c threadproc.h
  Log:
  Modify APR so that if we build without threads, we do not create no-op
  functions.
  
  Revision  ChangesPath
  1.9   +13 -3 apache-2.0/src/lib/apr/include/apr_portable.h
  
  Index: apr_portable.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- apr_portable.h1999/10/11 17:51:47 1.8
  +++ apr_portable.h1999/10/21 14:31:19 1.9
  @@ -64,6 +64,7 @@
   extern C {
   #endif /* __cplusplus */
   
  +#include apr_config.h
   #include apr_general.h
   #include apr_thread_proc.h
   #include apr_file_io.h
  @@ -165,18 +166,23 @@
   #else
   /* No Interprocess serialization, too bad. */
   #endif
  +#if APR_HAS_THREADS
  +/* If no threads, no need for thread locks */
   #if defined (USE_PTHREAD_SERIALIZE)
   pthread_mutex_t *intraproc;
   #endif
  +#endif
   };
   
   typedef int   ap_os_file_t;
   typedef DIR   ap_os_dir_t;
   typedef int   ap_os_sock_t;
   typedef struct os_lock_t  ap_os_lock_t;
  +#if APR_HAS_THREADS  HAVE_PTHREAD_H
   typedef pthread_t ap_os_thread_t;
  -typedef pid_t ap_os_proc_t;
   typedef pthread_key_t ap_os_threadkey_t;
  +#endif
  +typedef pid_t ap_os_proc_t;
   typedef struct timevalap_os_time_t;
   #endif
   
  @@ -184,19 +190,23 @@
   ap_status_t ap_get_os_dir(ap_os_dir_t *, ap_dir_t *);  
   ap_status_t ap_get_os_sock(ap_os_sock_t *, ap_socket_t *);
   ap_status_t ap_get_os_lock(ap_os_lock_t *, ap_lock_t *); 
  -ap_status_t ap_get_os_thread(ap_os_thread_t *, ap_thread_t *);
   ap_status_t ap_get_os_proc(ap_os_proc_t *, ap_proc_t *); 
   ap_status_t ap_get_os_time(ap_os_time_t **, ap_time_t *); 
  +#if APR_HAS_THREADS  HAVE_PTHREAD_H
  +ap_status_t ap_get_os_thread(ap_os_thread_t *, ap_thread_t *);
   ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *, ap_key_t *);
  +#endif
   
   ap_status_t ap_put_os_file(ap_file_t **, ap_os_file_t *, ap_context_t *); 
   ap_status_t ap_put_os_dir(ap_dir_t **, ap_os_dir_t *, ap_context_t *); 
   ap_status_t ap_put_os_sock(ap_socket_t **, ap_os_sock_t *, ap_context_t *);
   ap_status_t ap_put_os_lock(ap_lock_t **, ap_os_lock_t *, ap_context_t *); 
  -ap_status_t ap_put_os_thread(ap_thread_t **, ap_os_thread_t *, ap_context_t 
*);
   ap_status_t ap_put_os_proc(ap_proc_t **, ap_os_proc_t *, ap_context_t *); 
   ap_status_t ap_put_os_time(ap_time_t **, ap_os_time_t *, ap_context_t *); 
  +#if APR_HAS_THREADS  HAVE_PTHREAD_H
  +ap_status_t ap_put_os_thread(ap_thread_t **, ap_os_thread_t *, ap_context_t 
*);
   ap_status_t ap_put_os_threadkey(ap_key_t **, ap_os_threadkey_t *, 
ap_context_t *);
  +#endif
   
   #ifdef __cplusplus
   }
  
  
  
  1.7   +4 -1  apache-2.0/src/lib/apr/locks/unix/intraproc.c
  
  Index: intraproc.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/intraproc.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- intraproc.c   1999/10/12 19:21:10 1.6
  +++ intraproc.c   1999/10/21 14:31:20 1.7
  @@ -52,12 +52,14 @@
* project, please see http://www.apache.org/.
*
*/
  -
  +#include apr_config.h
   #include apr_lock.h
   #include apr_general.h
   #include apr_lib.h
   #include locks.h
   
  +#if APR_HAS_THREADS
  +
   #if defined (USE_PTHREAD_SERIALIZE)  
   
   ap_status_t lock_intra_cleanup(void *data)
  @@ -119,4 +121,5 @@
   }
   return stat;
   }
  +#endif
   #endif
  
  
  
  1.11  +20 -0 apache-2.0/src/lib/apr/locks/unix/locks.c
  
  Index: locks.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- locks.c   1999/10/15 14:20:01 1.10
  +++ locks.c   1999/10/21 14:31:20 1.11
  @@ -96,9 +96,13 @@
   }
   
   if (type != APR_CROSS_PROCESS) {
  +#if APR_HAS_THREADS
   if ((stat = create_intra_lock(new)) != APR_SUCCESS) {
   return stat;
   }
  +#else
  +return APR_ENOTIMPL;
  +#endif
   }
   if (type != APR_INTRAPROCESS) {
   if ((stat = create_inter_lock(new)) != APR_SUCCESS) {
  @@ -118,9 +122,13 @@
   {
   ap_status_t stat;
   if (lock-type != APR_CROSS_PROCESS) {
  +#if APR_HAS_THREADS
   if ((stat = lock_intra(lock)) != APR_SUCCESS) {
   return stat;
   }
  +#else
  +return APR_ENOTIMPL;