提交 3a85348c authored 作者: Anthony Minessale's avatar Anthony Minessale

FSCORE-309

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12269 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 8b1a2e21
...@@ -142,6 +142,7 @@ static switch_memory_pool_t *XML_MEMORY_POOL = NULL; ...@@ -142,6 +142,7 @@ static switch_memory_pool_t *XML_MEMORY_POOL = NULL;
static switch_thread_rwlock_t *RWLOCK = NULL; static switch_thread_rwlock_t *RWLOCK = NULL;
static switch_thread_rwlock_t *B_RWLOCK = NULL; static switch_thread_rwlock_t *B_RWLOCK = NULL;
static switch_mutex_t *XML_LOCK = NULL; static switch_mutex_t *XML_LOCK = NULL;
static switch_mutex_t *XML_GEN_LOCK = NULL;
struct xml_section_t { struct xml_section_t {
...@@ -1553,12 +1554,12 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section, ...@@ -1553,12 +1554,12 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
if ((conf = switch_xml_find_child(xml, "section", "name", section)) && (tag = switch_xml_find_child(conf, tag_name, key_name, key_value))) { if ((conf = switch_xml_find_child(xml, "section", "name", section)) && (tag = switch_xml_find_child(conf, tag_name, key_name, key_value))) {
if (clone) { if (clone) {
char *x; char *x;
switch_mutex_lock(XML_LOCK); switch_mutex_lock(XML_GEN_LOCK);
x = switch_xml_toxml(tag, SWITCH_FALSE); x = switch_xml_toxml(tag, SWITCH_FALSE);
switch_mutex_unlock(XML_GEN_LOCK);
switch_assert(x); switch_assert(x);
*root = switch_xml_parse_str(x, strlen(x)); *root = switch_xml_parse_str(x, strlen(x));
*node = *root; *node = *root;
switch_mutex_unlock(XML_LOCK);
switch_xml_free(xml); switch_xml_free(xml);
} else { } else {
*node = tag; *node = tag;
...@@ -1904,6 +1905,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool, cons ...@@ -1904,6 +1905,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool, cons
*err = "Success"; *err = "Success";
switch_mutex_init(&XML_LOCK, SWITCH_MUTEX_NESTED, XML_MEMORY_POOL); switch_mutex_init(&XML_LOCK, SWITCH_MUTEX_NESTED, XML_MEMORY_POOL);
switch_mutex_init(&XML_GEN_LOCK, SWITCH_MUTEX_NESTED, XML_MEMORY_POOL);
switch_thread_rwlock_create(&RWLOCK, XML_MEMORY_POOL); switch_thread_rwlock_create(&RWLOCK, XML_MEMORY_POOL);
switch_thread_rwlock_create(&B_RWLOCK, XML_MEMORY_POOL); switch_thread_rwlock_create(&B_RWLOCK, XML_MEMORY_POOL);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论