You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2001/12/30 00:14:22 UTC

cvs commit: apr/test testlock.c testlockperf.c testprocmutex.c testthread.c

trawick     01/12/29 15:14:22

  Modified:    .        CHANGES configure.in
               file_io/os2 open.c
               include  apr.h.in apr_lock.h apr_proc_mutex.h
               locks/beos locks.c proc_mutex.c
               locks/netware locks.c proc_mutex.c
               locks/os2 locks.c proc_mutex.c
               locks/unix locks.c proc_mutex.c
               locks/win32 locks.c proc_mutex.c
               shmem/unix shmem.c
               test     testlock.c testlockperf.c testprocmutex.c
                        testthread.c
  Log:
  roll the extra apr_lock_create_np() functionality into apr_lock_create()
  and get rid of apr_lock_create_np(); apr_lock_create() has a new
  parameter for specifying the lock mechanism (or APR_LOCK_DEFAULT to let
  APR choose)
  
  (same for apr_proc_mutex_create_np() and apr_proc_mutex_create())
  
  Revision  Changes    Path
  1.201     +5 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.200
  retrieving revision 1.201
  diff -u -r1.200 -r1.201
  --- CHANGES	27 Dec 2001 17:04:16 -0000	1.200
  +++ CHANGES	29 Dec 2001 23:14:20 -0000	1.201
  @@ -1,5 +1,10 @@
   Changes with APR b1  
   
  +  *) apr_lock_create() and apr_proc_mutex_create() now have an
  +     additional parameter for specifying the lock mechanism.  
  +     apr_lock_create_np() and apr_proc_mutex_create_np() have been
  +     removed.  [Jeff Trawick]
  +
     *) Change the prototype of apr_thread_exit() so that the apr_status_t
        is no longer a pointer. It was difficult and sometimes hazardous
        to return a apr_status_t* at times, and this allows us to return
  
  
  
  1.391     +0 -19     apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.390
  retrieving revision 1.391
  diff -u -r1.390 -r1.391
  --- configure.in	14 Dec 2001 02:45:15 -0000	1.390
  +++ configure.in	29 Dec 2001 23:14:21 -0000	1.391
  @@ -1152,24 +1152,6 @@
           ;;
   esac
   
  -if test "$flockser$sysvser$fcntlser$procpthreadser" = "0000"; then
  -  lockcreatenp="0"
  -else
  -  lockcreatenp="1"
  -fi
  -
  -case $host in
  -    *-os2*)
  -        # The above tests detect a working flock on OS/2 
  -        # but we don't want to use it when we have native locks
  -        lockcreatenp="0"
  -        ;;
  -    *-beos*)
  -        # This applies to beos as well
  -        lockcreatenp="0"
  -        ;;
  -esac
  -
   AC_SUBST(hasflockser)
   AC_SUBST(hassysvser)
   AC_SUBST(hasfcntlser)
  @@ -1180,7 +1162,6 @@
   AC_SUBST(fcntlser)
   AC_SUBST(procpthreadser)
   AC_SUBST(pthreadser)
  -AC_SUBST(lockcreatenp)
   
   AC_MSG_CHECKING(if interprocess lock affects threads)
   if test "x$apr_process_lock_is_global" = "xyes"; then
  
  
  
  1.46      +2 -1      apr/file_io/os2/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/os2/open.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- open.c	10 Aug 2001 21:04:47 -0000	1.45
  +++ open.c	29 Dec 2001 23:14:21 -0000	1.46
  @@ -99,7 +99,8 @@
   
       if (dafile->buffered) {
           dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE);
  -        rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt);
  +        rv = apr_lock_create(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, 
  +                             APR_LOCK_DEFAULT, NULL, cntxt);
   
           if (rv)
               return rv;
  
  
  
  1.96      +0 -2      apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.h.in,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- apr.h.in	4 Dec 2001 02:26:13 -0000	1.95
  +++ apr.h.in	29 Dec 2001 23:14:21 -0000	1.96
  @@ -81,8 +81,6 @@
   #define APR_HAS_PROC_PTHREAD_SERIALIZE    @hasprocpthreadser@
   #define APR_HAS_RWLOCK_SERIALIZE          @hasrwlockser@
   
  -#define APR_HAS_LOCK_CREATE_NP            @lockcreatenp@
  -
   #define APR_PROCESS_LOCK_IS_GLOBAL        @proclockglobal@
   
   #define APR_USES_ANONYMOUS_SHM            @anonymous_shm@
  
  
  
  1.31      +14 -46    apr/include/apr_lock.h
  
  Index: apr_lock.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_lock.h,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- apr_lock.h	17 Aug 2001 03:54:04 -0000	1.30
  +++ apr_lock.h	29 Dec 2001 23:14:21 -0000	1.31
  @@ -80,6 +80,9 @@
   
   typedef enum {APR_READER, APR_WRITER} apr_readerwriter_e;
   
  +typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PTHREAD,
  +              APR_LOCK_DEFAULT} apr_lockmech_e;
  +
   typedef struct apr_lock_t    apr_lock_t;
   
   /*   Function definitions */
  @@ -99,16 +102,27 @@
    *            APR_LOCKALL          lock processes and threads from the
    *                                 protected area.
    * </PRE>
  + * @param mech The mechanism to use for the interprocess lock, if any; one of
  + * <PRE>
  + *            APR_LOCK_FCNTL
  + *            APR_LOCK_FLOCK
  + *            APR_LOCK_SYSVSEM
  + *            APR_LOCK_PROC_PTHREAD
  + *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
  + * </PRE>
    * @param fname A file name to use if the lock mechanism requires one.  This
    *        argument should always be provided.  The lock code itself will
    *        determine if it should be used.
    * @param pool The pool to operate on.
    * @warning APR_CROSS_PROCESS may lock both processes and threads, but it is
    *          only guaranteed to lock processes.
  + * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
  + *          APR_LOCK_foo.  Only APR_LOCK_DEFAULT is portable.
    */
   APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock,
                                             apr_locktype_e type,
                                             apr_lockscope_e scope,
  +                                          apr_lockmech_e mech,
                                             const char *fname,
                                             apr_pool_t *pool);
   
  @@ -184,52 +198,6 @@
                                              const char *key,
                                              apr_status_t (*cleanup)(void *));
   
  -#if APR_HAS_LOCK_CREATE_NP
  -
  -typedef enum {APR_LOCK_FCNTL, APR_LOCK_FLOCK, APR_LOCK_SYSVSEM, APR_LOCK_PROC_PTHREAD,
  -              APR_LOCK_DEFAULT} apr_lockmech_e_np;
  -
  -/**
  - * non-portable interface to apr_lock_create()
  - *
  - * Create a new instance of a lock structure.  This is like apr_lock_create()
  - * but has some non-portable parameters.  This should be used sparingly.
  - *
  - * @param lock The newly created lock structure.
  - * @param type The type of lock to create, one of:
  - * <PRE>
  - *            APR_MUTEX
  - *            APR_READWRITE
  - * </PRE>
  - * @param scope The scope of the lock to create, one of:
  - * <PRE>
  - *            APR_CROSS_PROCESS    lock processes from the protected area.
  - *            APR_INTRAPROCESS     lock threads from the protected area.
  - *            APR_LOCKALL          lock processes and threads from the
  - *                                 protected area.
  - * </PRE>
  - * @param mech The mechanism to use for the interprocess lock, if any; one of
  - * <PRE>
  - *            APR_LOCK_FCNTL
  - *            APR_LOCK_FLOCK
  - *            APR_LOCK_SYSVSEM
  - *            APR_LOCK_PROC_PTHREAD
  - *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
  - * </PRE>
  - * @param fname A file name to use if the lock mechanism requires one.  This
  - *        argument should always be provided.  The lock code itself will
  - *        determine if it should be used.
  - * @param pool The pool to operate on.
  - * @warning APR_CROSS_PROCESS may lock both processes and threads, but it is
  - *          only guaranteed to lock processes.
  - */
  -APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock,
  -                                             apr_locktype_e type,
  -                                             apr_lockscope_e scope,
  -                                             apr_lockmech_e_np mech,
  -                                             const char *fname,
  -                                             apr_pool_t *pool);
  -#endif /* APR_HAS_LOCK_CREATE_NP */
   /** @} */
   #ifdef __cplusplus
   }
  
  
  
  1.4       +6 -21     apr/include/apr_proc_mutex.h
  
  Index: apr_proc_mutex.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_proc_mutex.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_proc_mutex.h	29 Sep 2001 05:03:37 -0000	1.3
  +++ apr_proc_mutex.h	29 Dec 2001 23:14:21 -0000	1.4
  @@ -86,21 +86,6 @@
    * @param fname A file name to use if the lock mechanism requires one.  This
    *        argument should always be provided.  The lock code itself will
    *        determine if it should be used.
  - * @param pool the pool from which to allocate the mutex.
  - */
  -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
  -                                                const char *fname,
  -                                                apr_pool_t *pool);
  -
  -/**
  - * non-portable interface to apr_proc_mutex_create()
  - *
  - * Create and initialize a mutex that can be used to synchronize processes.
  - * @param mutex the memory address where the newly created mutex will be
  - *        stored.
  - * @param fname A file name to use if the lock mechanism requires one.  This
  - *        argument should always be provided.  The lock code itself will
  - *        determine if it should be used.
    * @param mech The mechanism to use for the interprocess lock, if any; one of
    * <PRE>
    *            APR_LOCK_FCNTL
  @@ -110,13 +95,13 @@
    *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
    * </PRE>
    * @param pool the pool from which to allocate the mutex.
  + * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
  + *          APR_LOCK_foo.  Only APR_LOCK_DEFAULT is portable.
    */
  -#if APR_HAS_LOCK_CREATE_NP
  -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
  -                                                   const char *fname,
  -                                                   apr_lockmech_e_np mech,
  -                                                   apr_pool_t *pool);
  -#endif
  +APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
  +                                                const char *fname,
  +                                                apr_lockmech_e mech,
  +                                                apr_pool_t *pool);
   
   /**
    * Re-open a mutex in a child process.
  
  
  
  1.35      +7 -3      apr/locks/beos/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/beos/locks.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- locks.c	10 Aug 2001 21:04:47 -0000	1.34
  +++ locks.c	29 Dec 2001 23:14:21 -0000	1.35
  @@ -274,12 +274,16 @@
   }
   
   APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
  -                                          apr_lockscope_e scope, const char *fname, 
  -                                          apr_pool_t *pool)
  +                                          apr_lockscope_e scope, apr_lockmech_e mech,
  +                                          const char *fname, apr_pool_t *pool)
   {
       apr_lock_t *new;
       apr_status_t stat = APR_SUCCESS;
  -  
  +
  +    if (mech != APR_LOCK_DEFAULT) {
  +        return APR_ENOTIMPL;
  +    }
  +
       new = (apr_lock_t *)apr_pcalloc(pool, sizeof(apr_lock_t));
       if (new == NULL){
           return APR_ENOMEM;
  
  
  
  1.6       +5 -10     apr/locks/beos/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/beos/proc_mutex.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- proc_mutex.c	23 Dec 2001 13:06:40 -0000	1.5
  +++ proc_mutex.c	29 Dec 2001 23:14:21 -0000	1.6
  @@ -79,11 +79,16 @@
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
                                                   const char *fname,
  +                                                apr_lockmech_e mech,
                                                   apr_pool_t *pool)
   {
       apr_proc_mutex_t *new;
       apr_status_t stat = APR_SUCCESS;
     
  +    if (mech != APR_LOCK_DEFAULT) {
  +        return APR_ENOTIMPL;
  +    }
  +
       new = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t));
       if (new == NULL){
           return APR_ENOMEM;
  @@ -103,16 +108,6 @@
       (*mutex) = new;
       return APR_SUCCESS;
   }
  -
  -#if APR_HAS_CREATE_LOCKS_NP
  -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
  -                                                   const char *fname,
  -                                                   apr_lockmech_e_np mech,
  -                                                   apr_pool_t *pool)
  -{
  -    return APR_ENOTIMPL;
  -}       
  -#endif
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
                                                       const char *fname,
  
  
  
  1.2       +5 -1      apr/locks/netware/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/netware/locks.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- locks.c	6 Aug 2001 15:50:49 -0000	1.1
  +++ locks.c	29 Dec 2001 23:14:21 -0000	1.2
  @@ -76,7 +76,7 @@
   }
   
   apr_status_t apr_lock_create(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, 
  -                                          const char *fname, apr_pool_t *pool)
  +                             apr_lockmech_e mech, const char *fname, apr_pool_t *pool)
   {
      
       apr_lock_t *newlock = NULL;
  @@ -94,6 +94,10 @@
   	NXLockInfo_t *info;			   //for libc NKS NXRwLockAlloc
       apr_status_t status;
       long flags = 0;
  +
  +    if (mech != APR_LOCK_DEFAULT) {
  +        return APR_ENOTIMPL;
  +    }
   
       newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
   	
  
  
  
  1.4       +1 -8      apr/locks/netware/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/netware/proc_mutex.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- proc_mutex.c	19 Oct 2001 23:25:28 -0000	1.3
  +++ proc_mutex.c	29 Dec 2001 23:14:21 -0000	1.4
  @@ -61,18 +61,11 @@
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
                                                   const char *fname,
  +                                                apr_lockmech_e mech,
                                                   apr_pool_t *pool)
   {
       return APR_ENOTIMPL;
   }
  -
  -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
  -                                                   const char *fname,
  -                                                   apr_lockmech_e_np mech,
  -                                                   apr_pool_t *pool)
  -{
  -    return APR_ENOTIMPL;
  -}       
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
                                                       const char *fname,
  
  
  
  1.36      +6 -2      apr/locks/os2/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/os2/locks.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- locks.c	10 Aug 2001 21:04:47 -0000	1.35
  +++ locks.c	29 Dec 2001 23:14:21 -0000	1.36
  @@ -72,8 +72,8 @@
   
   
   APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
  -                                          apr_lockscope_e scope, const char *fname, 
  -                                          apr_pool_t *pool)
  +                                          apr_lockscope_e scope, apr_lockmech_e mech,
  +                                          const char *fname, apr_pool_t *pool)
   {
       apr_lock_t *new;
       ULONG rc;
  @@ -83,6 +83,10 @@
       /* FIXME: Remove when read write locks implemented. */
       if (type == APR_READWRITE)
           return APR_ENOTIMPL;
  +
  +    if (mech != APR_LOCK_DEFAULT) {
  +        return APR_ENOTIMPL;
  +    }
   
       new = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
   
  
  
  
  1.6       +1 -10     apr/locks/os2/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/os2/proc_mutex.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- proc_mutex.c	29 Dec 2001 10:03:39 -0000	1.5
  +++ proc_mutex.c	29 Dec 2001 23:14:21 -0000	1.6
  @@ -62,20 +62,11 @@
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
                                                   const char *fname,
  +                                                apr_lockmech_e mech,
                                                   apr_pool_t *pool)
   {
       return APR_ENOTIMPL;
   }
  -
  -#if APR_HAS_LOCK_CREATE_NP
  -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
  -                                                   const char *fname,
  -                                                   apr_lockmech_e_np mech,
  -                                                   apr_pool_t *pool)
  -{
  -    return APR_ENOTIMPL;
  -}       
  -#endif
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
                                                       const char *fname,
  
  
  
  1.64      +5 -12     apr/locks/unix/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/locks.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- locks.c	24 Sep 2001 05:41:57 -0000	1.63
  +++ locks.c	29 Dec 2001 23:14:22 -0000	1.64
  @@ -128,7 +128,7 @@
       lockall_child_init
   };
   
  -static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e_np mech)
  +static apr_status_t choose_method(apr_lock_t *new, apr_lockmech_e mech)
   {
       switch (mech) {
       case APR_LOCK_FCNTL:
  @@ -178,7 +178,7 @@
       return APR_SUCCESS;
   }
   
  -static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e_np mech, const char *fname)
  +static apr_status_t create_lock(apr_lock_t *new, apr_lockmech_e mech, const char *fname)
   {
       apr_status_t stat;
   
  @@ -230,9 +230,9 @@
       return APR_SUCCESS;
   }
   
  -APR_DECLARE(apr_status_t) apr_lock_create_np(apr_lock_t **lock, apr_locktype_e type, 
  -                                             apr_lockscope_e scope, apr_lockmech_e_np mech,
  -                                             const char *fname, apr_pool_t *pool)
  +APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
  +                                          apr_lockscope_e scope, apr_lockmech_e mech,
  +                                          const char *fname, apr_pool_t *pool)
   {
       apr_lock_t *new;
       apr_status_t stat;
  @@ -251,13 +251,6 @@
   
       *lock = new;
       return APR_SUCCESS;
  -}
  -
  -APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, apr_locktype_e type, 
  -                                          apr_lockscope_e scope, const char *fname, 
  -                                          apr_pool_t *pool)
  -{
  -    return apr_lock_create_np(lock, type, scope, APR_LOCK_DEFAULT, fname, pool);
   }
   
   APR_DECLARE(apr_status_t) apr_lock_acquire(apr_lock_t *lock)
  
  
  
  1.9       +3 -18     apr/locks/unix/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- proc_mutex.c	25 Oct 2001 14:52:43 -0000	1.8
  +++ proc_mutex.c	29 Dec 2001 23:14:22 -0000	1.9
  @@ -624,15 +624,7 @@
   #endif
   }
   
  -
  -
  -
  -
  -
  -
  -
  -
  -static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e_np mech)
  +static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech)
   {
       switch (mech) {
       case APR_LOCK_FCNTL:
  @@ -682,7 +674,7 @@
       return APR_SUCCESS;
   }
   
  -static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e_np mech, const char *fname)
  +static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech, const char *fname)
   {
       apr_status_t rv;
   
  @@ -703,15 +695,8 @@
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
                                                   const char *fname,
  +                                                apr_lockmech_e mech,
                                                   apr_pool_t *pool)
  -{
  -    return apr_proc_mutex_create_np(mutex, fname, APR_LOCK_DEFAULT, pool);
  -}
  -
  -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
  -                                                   const char *fname,
  -                                                   apr_lockmech_e_np mech,
  -                                                   apr_pool_t *pool)
   {
       apr_proc_mutex_t *new_mutex;
       apr_status_t rv;
  
  
  
  1.48      +5 -0      apr/locks/win32/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/win32/locks.c,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- locks.c	27 Nov 2001 05:22:34 -0000	1.47
  +++ locks.c	29 Dec 2001 23:14:22 -0000	1.48
  @@ -85,6 +85,7 @@
   APR_DECLARE(apr_status_t) apr_lock_create(apr_lock_t **lock, 
                                             apr_locktype_e type, 
                                             apr_lockscope_e scope, 
  +                                          apr_lockmech_e mech,
                                             const char *fname,
                                             apr_pool_t *pool)
   {
  @@ -94,6 +95,10 @@
       /* FIXME: Remove when read write locks implemented. */
       if (type == APR_READWRITE)
           return APR_ENOTIMPL;
  +
  +    if (mech != APR_LOCK_DEFAULT) {
  +        return APR_ENOTIMPL;
  +    }
   
       newlock = (apr_lock_t *)apr_palloc(pool, sizeof(apr_lock_t));
   
  
  
  
  1.4       +1 -8      apr/locks/win32/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/win32/proc_mutex.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- proc_mutex.c	19 Oct 2001 23:25:28 -0000	1.3
  +++ proc_mutex.c	29 Dec 2001 23:14:22 -0000	1.4
  @@ -61,15 +61,8 @@
   
   APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
                                                   const char *fname,
  +                                                apr_lockmech_e mech,
                                                   apr_pool_t *pool)
  -{
  -    return APR_ENOTIMPL;
  -}
  -
  -APR_DECLARE(apr_status_t) apr_proc_mutex_create_np(apr_proc_mutex_t **mutex,
  -                                                   const char *fname,
  -                                                   apr_lockmech_e_np mech,
  -                                                   apr_pool_t *pool)
   {
       return APR_ENOTIMPL;
   }
  
  
  
  1.34      +2 -1      apr/shmem/unix/shmem.c
  
  Index: shmem.c
  ===================================================================
  RCS file: /home/cvs/apr/shmem/unix/shmem.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- shmem.c	30 Aug 2001 17:11:04 -0000	1.33
  +++ shmem.c	29 Dec 2001 23:14:22 -0000	1.34
  @@ -209,7 +209,8 @@
       new_m->curmem = mem;
       new_m->length = reqsize;
   
  -    apr_lock_create(&new_m->lock, APR_MUTEX, APR_CROSS_PROCESS, NULL, pool);
  +    apr_lock_create(&new_m->lock, APR_MUTEX, APR_CROSS_PROCESS, 
  +                    APR_LOCK_DEFAULT, NULL, pool);
       if (!new_m->lock)
           return APR_EGENERAL;
   
  
  
  
  1.16      +4 -4      apr/test/testlock.c
  
  Index: testlock.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testlock.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- testlock.c	2 Dec 2001 14:02:16 -0000	1.15
  +++ testlock.c	29 Dec 2001 23:14:22 -0000	1.16
  @@ -267,7 +267,7 @@
       printf("RW Lock Tests\n");
       printf("%-60s", "    Initializing the RW lock");
       s1 = apr_lock_create(&thread_rw_lock, APR_READWRITE, APR_INTRAPROCESS,
  -                         "lock.file", pool);
  +                         APR_LOCK_DEFAULT, "lock.file", pool);
       if (s1 != APR_SUCCESS) {
           printf("Failed!\n");
           return s1;
  @@ -315,7 +315,7 @@
       printf("Exclusive lock test\n");
       printf("%-60s", "    Initializing the lock");
       s1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, 
  -                         "lock.file", pool); 
  +                         APR_LOCK_DEFAULT, "lock.file", pool); 
   
       if (s1 != APR_SUCCESS) {
           printf("Failed!\n");
  @@ -363,8 +363,8 @@
    
       printf("Testing multiple locking\n");
       printf("%-60s","    Creating the lock we'll use");
  -    if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL, lockfile,
  -                        pool)) != APR_SUCCESS) {
  +    if ((rv = apr_lock_create(&multi, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT,
  +                              lockfile, pool)) != APR_SUCCESS) {
           printf("Failed!\n");
           return rv;
       }
  
  
  
  1.6       +3 -3      apr/test/testlockperf.c
  
  Index: testlockperf.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testlockperf.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- testlockperf.c	17 Oct 2001 00:33:00 -0000	1.5
  +++ testlockperf.c	29 Dec 2001 23:14:22 -0000	1.6
  @@ -154,8 +154,8 @@
   
       printf("apr_lock(INTRAPROCESS, MUTEX) Lock Tests\n");
       printf("%-60s", "    Initializing the apr_lock_t");
  -    s1 = apr_lock_create(&inter_lock, APR_MUTEX, APR_INTRAPROCESS,
  -                         "lock.file", pool);
  +    s1 = apr_lock_create(&inter_lock, APR_MUTEX, APR_INTRAPROCESS, 
  +                         APR_LOCK_DEFAULT, "lock.file", pool);
       if (s1 != APR_SUCCESS) {
           printf("Failed!\n");
           return s1;
  @@ -305,7 +305,7 @@
       printf("apr_lock(INTRAPROCESS, READWRITE) Lock Tests\n");
       printf("%-60s", "    Initializing the apr_lock_t");
       s1 = apr_lock_create(&inter_rwlock, APR_READWRITE, APR_INTRAPROCESS,
  -                         "lock.file", pool);
  +                         APR_LOCK_DEFAULT, "lock.file", pool);
       if (s1 != APR_SUCCESS) {
           printf("Failed!\n");
           return s1;
  
  
  
  1.6       +1 -1      apr/test/testprocmutex.c
  
  Index: testprocmutex.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testprocmutex.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- testprocmutex.c	23 Oct 2001 17:30:08 -0000	1.5
  +++ testprocmutex.c	29 Dec 2001 23:14:22 -0000	1.6
  @@ -104,7 +104,7 @@
    
       printf("Exclusive lock test\n");
       printf("%-60s", "    Initializing the lock");
  -    s1 = apr_proc_mutex_create(&proc_lock, lockname, pool);
  +    s1 = apr_proc_mutex_create(&proc_lock, lockname, APR_LOCK_DEFAULT, pool);
    
       if (s1 != APR_SUCCESS) {
           printf("Failed!\n");
  
  
  
  1.27      +2 -1      apr/test/testthread.c
  
  Index: testthread.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testthread.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- testthread.c	27 Dec 2001 17:03:00 -0000	1.26
  +++ testthread.c	29 Dec 2001 23:14:22 -0000	1.27
  @@ -129,7 +129,8 @@
       apr_thread_once_init(&control, context);
   
       printf("%-60s", "Initializing the lock"); 
  -    r1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); 
  +    r1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, 
  +                         APR_LOCK_DEFAULT, "lock.file", context); 
       if (r1 != APR_SUCCESS) {
           fflush(stdout);
           fprintf(stderr, "Failed\nCould not create lock\n");