提交 b117a65c authored 作者: Anthony Minessale's avatar Anthony Minessale

put a little contention in the reg in new thread feature to prevent endless pileup

上级 ad7149bf
...@@ -1306,6 +1306,7 @@ void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep) ...@@ -1306,6 +1306,7 @@ void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep)
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
switch_memory_pool_t *pool; switch_memory_pool_t *pool;
switch_thread_t *thread; switch_thread_t *thread;
sofia_profile_t *profile = (*dep)->profile;
switch_core_new_memory_pool(&pool); switch_core_new_memory_pool(&pool);
...@@ -1313,6 +1314,7 @@ void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep) ...@@ -1313,6 +1314,7 @@ void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep)
*dep = NULL; *dep = NULL;
de->pool = pool; de->pool = pool;
switch_mutex_lock(profile->ireg_mutex);
switch_threadattr_create(&thd_attr, de->pool); switch_threadattr_create(&thd_attr, de->pool);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_thread_create(&thread, switch_thread_create(&thread,
...@@ -1320,7 +1322,7 @@ void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep) ...@@ -1320,7 +1322,7 @@ void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep)
sofia_msg_thread_run_once, sofia_msg_thread_run_once,
de, de,
de->pool); de->pool);
switch_mutex_unlock(profile->ireg_mutex);
} }
......
...@@ -1420,7 +1420,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc ...@@ -1420,7 +1420,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
gethostname(runtime.hostname, sizeof(runtime.hostname)); gethostname(runtime.hostname, sizeof(runtime.hostname));
runtime.max_db_handles = 50; runtime.max_db_handles = 50;
runtime.db_handle_timeout = 5000000;; runtime.db_handle_timeout = 5000000;
runtime.runlevel++; runtime.runlevel++;
runtime.sql_buffer_len = 1024 * 32; runtime.sql_buffer_len = 1024 * 32;
......
...@@ -218,7 +218,7 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t ...@@ -218,7 +218,7 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t
} }
#define SQL_CACHE_TIMEOUT 120 #define SQL_CACHE_TIMEOUT 30
#define SQL_REG_TIMEOUT 15 #define SQL_REG_TIMEOUT 15
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论