apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/locks/unix thread_rwlock.c
Date Fri, 14 Sep 2001 15:39:38 GMT
rbb         01/09/14 08:39:38

  Modified:    include/arch/unix thread_rwlock.h
               locks/unix thread_rwlock.c
  Log:
  Just because we have pthreads, that doesn't mean we have pthread_rwlock.
  This removes support for rwlock on platforms that don't have them.  I will
  write an implementation of rwlocks that don't rely on pthreads later this
  weekend.
  
  Revision  Changes    Path
  1.2       +9 -0      apr/include/arch/unix/thread_rwlock.h
  
  Index: thread_rwlock.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/thread_rwlock.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- thread_rwlock.h	2001/09/08 23:36:34	1.1
  +++ thread_rwlock.h	2001/09/14 15:39:38	1.2
  @@ -67,10 +67,19 @@
   #endif
   
   #if APR_HAS_THREADS
  +#if HAVE_PTHREAD_RWLOCK_INIT
  +
   struct apr_thread_rwlock_t {
       apr_pool_t *pool;
       pthread_rwlock_t *rwlock;
   };
  +
  +#else
  +
  +struct apr_thread_rwlock_t {
  +};
  +#endif
  +
   #endif
   
   #endif  /* THREAD_RWLOCK_H */
  
  
  
  1.2       +48 -0     apr/locks/unix/thread_rwlock.c
  
  Index: thread_rwlock.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/thread_rwlock.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- thread_rwlock.c	2001/09/08 23:36:34	1.1
  +++ thread_rwlock.c	2001/09/14 15:39:38	1.2
  @@ -53,9 +53,12 @@
    */
   
   #include "thread_rwlock.h"
  +#include "apr_private.h"
   
   #if APR_HAS_THREADS
   
  +#ifdef HAVE_PTHREAD_RWLOCK_INIT
  +
   static apr_status_t thread_rwlock_cleanup(void *data)
   {
       apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data;
  @@ -188,5 +191,50 @@
       }
       return stat;
   }
  +
  +#else  /* HAVE_PTHREAD_RWLOCK_INIT */
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock,
  +                                                   apr_pool_t *pool)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_lock(apr_thread_rwlock_t *rwlock)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock)
  +{
  +    return APR_ENOTIMPL;
  +}
  +
  +#endif /* HAVE_PTHREAD_RWLOCK_INIT */
   
   #endif /* APR_HAS_THREADS */
  
  
  

Mime
View raw message