apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr-util/include apr_anylock.h
Date Tue, 08 Jan 2002 13:00:30 GMT
trawick     02/01/08 05:00:30

  Modified:    include  apr_anylock.h
  Log:
  handle !APR_HAS_THREADS
  
  Revision  Changes    Path
  1.3       +40 -0     apr-util/include/apr_anylock.h
  
  Index: apr_anylock.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_anylock.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_anylock.h	8 Jan 2002 06:26:31 -0000	1.2
  +++ apr_anylock.h	8 Jan 2002 13:00:30 -0000	1.3
  @@ -73,11 +73,15 @@
       } type;
       union apr_anylock_u_t {
           apr_proc_mutex_t *pm;
  +#if APR_HAS_THREADS
           apr_thread_mutex_t *tm;
           apr_thread_rwlock_t *rw;
  +#endif
       } lock;
   } apr_anylock_t;
   
  +#if APR_HAS_THREADS
  +
   #define APR_ANYLOCK_LOCK(lck)                \
       (((lck)->type == apr_anylock_none)         \
         ? APR_SUCCESS                              \
  @@ -91,6 +95,19 @@
                         ? apr_thread_rwlock_wrlock((lck)->lock.rw) \
                         : APR_EINVAL)))))
   
  +#else /* APR_HAS_THREADS */
  +
  +#define APR_ANYLOCK_LOCK(lck)                \
  +    (((lck)->type == apr_anylock_none)         \
  +      ? APR_SUCCESS                              \
  +          : (((lck)->type == apr_anylock_procmutex)    \
  +              ? apr_proc_mutex_lock((lck)->lock.pm)      \
  +                      : APR_EINVAL))
  +
  +#endif /* APR_HAS_THREADS */
  +
  +#if APR_HAS_THREADS
  +
   #define APR_ANYLOCK_TRYLOCK(lck)                \
       (((lck)->type == apr_anylock_none)            \
         ? APR_SUCCESS                                 \
  @@ -104,6 +121,19 @@
                         ? apr_thread_rwlock_trywrlock((lck)->lock.rw) \
                             : APR_EINVAL)))))
   
  +#else /* APR_HAS_THREADS */
  +
  +#define APR_ANYLOCK_TRYLOCK(lck)                \
  +    (((lck)->type == apr_anylock_none)            \
  +      ? APR_SUCCESS                                 \
  +          : (((lck)->type == apr_anylock_procmutex)       \
  +              ? apr_proc_mutex_trylock((lck)->lock.pm)      \
  +                          : APR_EINVAL))
  +
  +#endif /* APR_HAS_THREADS */
  +
  +#if APR_HAS_THREADS
  +
   #define APR_ANYLOCK_UNLOCK(lck)              \
       (((lck)->type == apr_anylock_none)         \
         ? APR_SUCCESS                              \
  @@ -116,5 +146,15 @@
                     ? apr_thread_rwlock_unlock((lck)->lock.rw)   \
                         : APR_EINVAL))))
   
  +#else /* APR_HAS_THREADS */
  +
  +#define APR_ANYLOCK_UNLOCK(lck)              \
  +    (((lck)->type == apr_anylock_none)         \
  +      ? APR_SUCCESS                              \
  +          : (((lck)->type == apr_anylock_procmutex)    \
  +              ? apr_proc_mutex_unlock((lck)->lock.pm)    \
  +                      : APR_EINVAL))
  +
  +#endif /* APR_HAS_THREADS */
   
   #endif /* !APR_ANYLOCK_H */
  
  
  

Mime
View raw message