subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1182269 - /subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c
Date Wed, 12 Oct 2011 08:55:59 GMT
Author: philip
Date: Wed Oct 12 08:55:59 2011
New Revision: 1182269

URL: http://svn.apache.org/viewvc?rev=1182269&view=rev
Log:
* subversion/libsvn_ra_svn/cyrus_auth.c
  (sasl_mutex_alloc_cb, sasl_mutex_free_cb): Avoid SVN_MUTEX__WITH_LOCK
   in functions not returning svn_error_t*.

Modified:
    subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c

Modified: subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1182269&r1=1182268&r2=1182269&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c Wed Oct 12 08:55:59 2011
@@ -103,11 +103,17 @@ sasl_mutex_alloc_cb_internal(svn_mutex__
 static void *sasl_mutex_alloc_cb(void)
 {
   svn_mutex__t *mutex = NULL;
+  svn_error_t *err;
 
   if (!svn_ra_svn__sasl_status)
     return NULL;
 
-  SVN_MUTEX__WITH_LOCK(array_mutex, sasl_mutex_alloc_cb_internal(&mutex));
+  err = svn_mutex__lock(array_mutex);
+  if (err)
+    svn_error_clear(err);
+  else
+    svn_error_clear(svn_mutex__unlock(array_mutex,
+                                      sasl_mutex_alloc_cb_internal(&mutex)));
 
   return mutex;
 }
@@ -146,8 +152,17 @@ sasl_mutex_free_cb_internal(void *mutex)
 
 static void sasl_mutex_free_cb(void *mutex)
 {
-  if (svn_ra_svn__sasl_status)
-    SVN_MUTEX__WITH_LOCK(array_mutex, sasl_mutex_free_cb_internal(mutex));
+  svn_error_t *err;
+
+  if (!svn_ra_svn__sasl_status)
+    return;
+
+  err = svn_mutex__lock(array_mutex);
+  if (err)
+    svn_error_clear(err);
+  else
+    svn_error_clear(svn_mutex__unlock(array_mutex,
+                                      sasl_mutex_free_cb_internal(mutex)));
 }
 #endif /* APR_HAS_THREADS */
 



Mime
View raw message