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/08/23 12:17:25 UTC

svn commit: r1160605 - in /subversion/trunk/subversion/libsvn_subr: svn_cache_config.c utf.c

Author: philip
Date: Tue Aug 23 10:17:25 2011
New Revision: 1160605

URL: http://svn.apache.org/viewvc?rev=1160605&view=rev
Log:
The UTF handles should be "volatile pointers" not "pointers to volatile".

* subversion/libsvn_subr/utf.c
  (): Change type of static handles.
  (atomic_swap): Change type of parameter, comment on cast.

* subversion/libsvn_subr/svn_cache_config.c
  (svn_cache__get_global_membuffer_cache): Comment on cast.

Modified:
    subversion/trunk/subversion/libsvn_subr/svn_cache_config.c
    subversion/trunk/subversion/libsvn_subr/utf.c

Modified: subversion/trunk/subversion/libsvn_subr/svn_cache_config.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/svn_cache_config.c?rev=1160605&r1=1160604&r2=1160605&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/svn_cache_config.c (original)
+++ subversion/trunk/subversion/libsvn_subr/svn_cache_config.c Tue Aug 23 10:17:25 2011
@@ -147,6 +147,9 @@ svn_cache__get_global_membuffer_cache(vo
       /* Handle race condition: if we are the first to create a
        * cache object, make it our global singleton. Otherwise,
        * discard the new cache and keep the existing one.
+       *
+       * Cast is necessary because of APR bug:
+       * https://issues.apache.org/bugzilla/show_bug.cgi?id=50731
        */
       old_cache = apr_atomic_casptr((volatile void **)&cache, new_cache, NULL);
       if (old_cache != NULL)

Modified: subversion/trunk/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/utf.c?rev=1160605&r1=1160604&r2=1160605&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/utf.c (original)
+++ subversion/trunk/subversion/libsvn_subr/utf.c Tue Aug 23 10:17:25 2011
@@ -90,8 +90,8 @@ static apr_hash_t *xlate_handle_hash = N
  * using atomic xchange ops, i.e. without further thread synchronization.
  * If the respective item is NULL, fallback to hash lookup.
  */
-static volatile void *xlat_ntou_static_handle = NULL;
-static volatile void *xlat_uton_static_handle = NULL;
+static void * volatile xlat_ntou_static_handle = NULL;
+static void * volatile xlat_uton_static_handle = NULL;
 
 /* Clean up the xlate handle cache. */
 static apr_status_t
@@ -182,11 +182,13 @@ get_xlate_key(const char *topage,
  * the caller.
  */
 static APR_INLINE void*
-atomic_swap(volatile void **mem, void *new_value)
+atomic_swap(void * volatile * mem, void *new_value)
 {
 #if APR_HAS_THREADS
 #if APR_VERSION_AT_LEAST(1,3,0)
-   return apr_atomic_xchgptr(mem, new_value);
+  /* Cast is necessary because of APR bug:
+     https://issues.apache.org/bugzilla/show_bug.cgi?id=50731 */
+   return apr_atomic_xchgptr((volatile void **)mem, new_value);
 #else
    /* old APRs don't support atomic swaps. Simply return the
     * input to the caller for further proccessing. */