You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/10/18 23:05:24 UTC

svn commit: r1185860 - /subversion/trunk/subversion/libsvn_subr/svn_mutex.c

Author: stefan2
Date: Tue Oct 18 21:05:24 2011
New Revision: 1185860

URL: http://svn.apache.org/viewvc?rev=1185860&view=rev
Log:
Set the mutex pointer to a defined value even if synchronization
is not supported and the pointer will never actually be accessed.

* subversion/libsvn_subr/svn_mutex.c
  (svn_mutex__init): NULL the mutex if APR has no threads

Modified:
    subversion/trunk/subversion/libsvn_subr/svn_mutex.c

Modified: subversion/trunk/subversion/libsvn_subr/svn_mutex.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/svn_mutex.c?rev=1185860&r1=1185859&r2=1185860&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/svn_mutex.c (original)
+++ subversion/trunk/subversion/libsvn_subr/svn_mutex.c Tue Oct 18 21:05:24 2011
@@ -29,8 +29,12 @@ svn_mutex__init(svn_mutex__t **mutex_p, 
                 svn_boolean_t enable_mutex, 
                 apr_pool_t *result_pool)
 {
-#if APR_HAS_THREADS
+  // always initialize the mutex pointer, even though it is not
+  // strictly necessary if APR_HAS_THREADS has not been set
+
   *mutex_p = NULL;
+
+#if APR_HAS_THREADS
   if (enable_mutex)
     {
       apr_thread_mutex_t *apr_mutex;