apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: apr/file_io/unix open.c filedup.c readwrite.c
Date Fri, 15 Mar 2002 02:25:01 GMT
brianp      02/03/14 18:25:00

  Modified:    file_io/unix open.c filedup.c readwrite.c
  Log:
  CHANGES
  
  Revision  Changes    Path
  1.93      +6 -4      apr/file_io/unix/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/open.c,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- open.c	13 Mar 2002 20:39:11 -0000	1.92
  +++ open.c	15 Mar 2002 02:25:00 -0000	1.93
  @@ -123,10 +123,12 @@
       if ((*new)->buffered) {
           (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE);
   #if APR_HAS_THREADS
  -        rv = apr_thread_mutex_create(&((*new)->thlock),
  -                                     APR_THREAD_MUTEX_DEFAULT, cont);
  -        if (rv) {
  -            return rv;
  +        if ((*new)->flags & APR_XTHREAD) {
  +            rv = apr_thread_mutex_create(&((*new)->thlock),
  +                                         APR_THREAD_MUTEX_DEFAULT, cont);
  +            if (rv) {
  +                return rv;
  +            }
           }
   #endif
       }
  
  
  
  1.46      +1 -1      apr/file_io/unix/filedup.c
  
  Index: filedup.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/filedup.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- filedup.c	13 Mar 2002 20:39:11 -0000	1.45
  +++ filedup.c	15 Mar 2002 02:25:00 -0000	1.46
  @@ -94,7 +94,7 @@
        * want to create it again as we could leak!
        */
   #if APR_HAS_THREADS
  -    if ((*new_file)->buffered && !(*new_file)->thlock) {
  +    if ((*new_file)->buffered && !(*new_file)->thlock && old_file->thlock)
{
           apr_thread_mutex_create(&((*new_file)->thlock),
                                   APR_THREAD_MUTEX_DEFAULT, p);
       }
  
  
  
  1.77      +12 -4     apr/file_io/unix/readwrite.c
  
  Index: readwrite.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/readwrite.c,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- readwrite.c	13 Mar 2002 20:39:11 -0000	1.76
  +++ readwrite.c	15 Mar 2002 02:25:00 -0000	1.77
  @@ -118,7 +118,9 @@
           apr_uint64_t size = *nbytes;
   
   #if APR_HAS_THREADS
  -        apr_thread_mutex_lock(thefile->thlock);
  +        if (thefile->thlock) {
  +            apr_thread_mutex_lock(thefile->thlock);
  +        }
   #endif
   
           if (thefile->direction == 1) {
  @@ -164,7 +166,9 @@
               rv = 0;
           }
   #if APR_HAS_THREADS
  -        apr_thread_mutex_unlock(thefile->thlock);
  +        if (thefile->thlock) {
  +            apr_thread_mutex_unlock(thefile->thlock);
  +        }
   #endif
           return rv;
       }
  @@ -223,7 +227,9 @@
           int size = *nbytes;
   
   #if APR_HAS_THREADS
  -        apr_thread_mutex_lock(thefile->thlock);
  +        if (thefile->thlock) {
  +            apr_thread_mutex_lock(thefile->thlock);
  +        }
   #endif
   
           if ( thefile->direction == 0 ) {
  @@ -251,7 +257,9 @@
           }
   
   #if APR_HAS_THREADS
  -        apr_thread_mutex_unlock(thefile->thlock);
  +        if (thefile->thlock) {
  +            apr_thread_mutex_unlock(thefile->thlock);
  +        }
   #endif
           return rv;
       }
  
  
  

Mime
View raw message