/[Apache-SVN]
ViewVC logotype

Revision 1532572


Jump to revision: Previous Next
Author: stefan2
Date: Tue Oct 15 22:32:44 2013 UTC (10 years, 6 months ago)
Changed paths: 5
Log Message:
Add support for read-only access to svn_config_t.  In read-only mode,
concurrent multi-threaded access to the same config data structure is 
safe.

We introduce a simple private API function that allows us to switch
a config struct into r/o mode (one-way as the reversal seems dangerous).
Part of that transition is expanding all values to prevent internal
state change upon later read access.

The code expects r/o structs not to be written to and simply ignores
write ops in release mode.  In debug mode, an assert()ion is triggered.
This is because the existing setter functions don't provide error
return values.

* subversion/libsvn_subr/config_impl.h
  (svn_config_t): add r/o flag to structure

* subversion/include/private/svn_subr_private.h
  (void svn_config__set_read_only): declare new private API function

* subversion/libsvn_subr/config_file.c
  (expand_value,
   expand_values_in_section): new transition utilities
  (svn_config__set_read_only): implement new API

* subversion/libsvn_subr/config.c
  (svn_config_create2): init new flag as well
  (make_string_from_option): assert that this gets never called in r/o mode
  (svn_config_set): in r/o mode no-op in release, assert() in debug

* subversion/libsvn_repos/config_pool.c
  (expand_value,
   expand_values_in_section,
   expand_all_values): drop obsolete functions
  (auto_parse): simply call new API to ensure correct r/o behavior

Changed paths

Path Details
Directorysubversion/trunk/subversion/include/private/svn_subr_private.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_repos/config_pool.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_subr/config.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_subr/config_file.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_subr/config_impl.h modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26