apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r329770 - /apr/apr-util/trunk/memcache/apr_memcache.c
Date Mon, 31 Oct 2005 08:39:31 GMT
Author: martin
Date: Mon Oct 31 00:39:25 2005
New Revision: 329770

URL: http://svn.apache.org/viewcvs?rev=329770&view=rev
Log:
In a non-threaded environment (like FreeBSD-4.x), make apr-util compile.


Modified:
    apr/apr-util/trunk/memcache/apr_memcache.c

Modified: apr/apr-util/trunk/memcache/apr_memcache.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/memcache/apr_memcache.c?rev=329770&r1=329769&r2=329770&view=diff
==============================================================================
--- apr/apr-util/trunk/memcache/apr_memcache.c (original)
+++ apr/apr-util/trunk/memcache/apr_memcache.c Mon Oct 31 00:39:25 2005
@@ -97,10 +97,14 @@
 
 static apr_status_t make_server_dead(apr_memcache_t *mc, apr_memcache_server_t *ms)
 {
+#if APR_HAS_THREADS
     apr_thread_mutex_lock(ms->lock);
+#endif
     ms->status = APR_MC_SERVER_DEAD;
     ms->btime = apr_time_now();
+#if APR_HAS_THREADS
     apr_thread_mutex_unlock(ms->lock);
+#endif
     return APR_SUCCESS;
 }
 
@@ -148,17 +152,23 @@
             if (curtime == 0) {
                 curtime = apr_time_now();
             }
+#if APR_HAS_THREADS
             apr_thread_mutex_lock(ms->lock);
+#endif
             /* Try the the dead server, every 5 seconds */
             if (curtime - ms->btime >  apr_time_from_sec(5)) {
                 if (mc_version_ping(ms) == APR_SUCCESS) {
                     ms->btime = curtime;
                     make_server_live(mc, ms);
+#if APR_HAS_THREADS
                     apr_thread_mutex_unlock(ms->lock);
+#endif
                     break;
                 }
             }
+#if APR_HAS_THREADS
             apr_thread_mutex_unlock(ms->lock);
+#endif
         }
         h++;
         i++;



Mime
View raw message