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/07/11 22:01:40 UTC
svn commit: r1145321 -
/subversion/branches/svn_mutex/subversion/libsvn_subr/dso.c
Author: stefan2
Date: Mon Jul 11 20:01:40 2011
New Revision: 1145321
URL: http://svn.apache.org/viewvc?rev=1145321&view=rev
Log:
On svn_mutex branch:
Switch dso loader to the safer SVN_MUTEX__WITH_LOCK macro.
Split that function into a wrapper doing that lock handling and
an "internal" function that does need to care about locking anymore.
* subversion/libsvn_subr/dso.c:
(svn_dso_load_internal): move logic part that must be sync'ed here
(svn_dso_load): remainder plus locked call to ^
Modified:
subversion/branches/svn_mutex/subversion/libsvn_subr/dso.c
Modified: subversion/branches/svn_mutex/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_subr/dso.c?rev=1145321&r1=1145320&r2=1145321&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_subr/dso.c Mon Jul 11 20:01:40 2011
@@ -61,14 +61,9 @@ svn_dso_initialize2(void)
}
#if APR_HAS_DSO
-svn_error_t *
-svn_dso_load(apr_dso_handle_t **dso, const char *fname)
+static svn_error_t *
+svn_dso_load_internal(apr_dso_handle_t **dso, const char *fname)
{
- if (! dso_pool)
- SVN_ERR(svn_dso_initialize2());
-
- SVN_ERR(svn_mutex__lock(dso_mutex));
-
*dso = apr_hash_get(dso_cache, fname, APR_HASH_KEY_STRING);
/* First check to see if we've been through this before... We do this
@@ -77,7 +72,7 @@ svn_dso_load(apr_dso_handle_t **dso, con
if (*dso == NOT_THERE)
{
*dso = NULL;
- return svn_mutex__unlock(dso_mutex, SVN_NO_ERROR);
+ return SVN_NO_ERROR;
}
/* If we got nothing back from the cache, try and load the library. */
@@ -98,7 +93,7 @@ svn_dso_load(apr_dso_handle_t **dso, con
APR_HASH_KEY_STRING,
NOT_THERE);
- return svn_mutex__unlock(dso_mutex, SVN_NO_ERROR);
+ return SVN_NO_ERROR;
}
/* Stash the dso so we can use it next time. */
@@ -108,6 +103,17 @@ svn_dso_load(apr_dso_handle_t **dso, con
*dso);
}
- return svn_mutex__unlock(dso_mutex, SVN_NO_ERROR);
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_dso_load(apr_dso_handle_t **dso, const char *fname)
+{
+ if (! dso_pool)
+ SVN_ERR(svn_dso_initialize2());
+
+ SVN_MUTEX__WITH_LOCK(dso_mutex, svn_dso_load_internal(dso, fname));
+
+ return SVN_NO_ERROR;
}
#endif /* APR_HAS_DSO */