You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2011/10/12 14:58:34 UTC
svn commit: r1182340 - /subversion/trunk/subversion/libsvn_subr/svn_mutex.c
Author: philip
Date: Wed Oct 12 12:58:34 2011
New Revision: 1182340
URL: http://svn.apache.org/viewvc?rev=1182340&view=rev
Log:
Attempting to automatically reset pointers is doomed when such
pointers can be non-static; stack or heap corruption is the
result. It is not necessary so remove it.
* subversion/libsvn_subr/svn_mutex.c
(destroy_mutex): Remove.
(svn_mutex__init): Don't install a pool cleanup.
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=1182340&r1=1182339&r2=1182340&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/svn_mutex.c (original)
+++ subversion/trunk/subversion/libsvn_subr/svn_mutex.c Wed Oct 12 12:58:34 2011
@@ -24,18 +24,6 @@
#include "svn_private_config.h"
#include "private/svn_mutex.h"
-#if APR_HAS_THREADS
-/* Destructor to be called as part of the pool cleanup procedure. */
-static apr_status_t
-destroy_mutex(void *data)
-{
- svn_mutex__t **mutex_p = data;
- *mutex_p = NULL;
-
- return APR_SUCCESS;
-}
-#endif
-
svn_error_t *
svn_mutex__init(svn_mutex__t **mutex_p,
svn_boolean_t enable_mutex,
@@ -54,8 +42,6 @@ svn_mutex__init(svn_mutex__t **mutex_p,
return svn_error_wrap_apr(status, _("Can't create mutex"));
*mutex_p = apr_mutex;
- apr_pool_cleanup_register(pool, mutex_p, destroy_mutex,
- apr_pool_cleanup_null);
}
#else
if (enable_mutex)