You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ma...@apache.org on 2005/10/31 09:39:31 UTC
svn commit: r329770 - /apr/apr-util/trunk/memcache/apr_memcache.c
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++;