tweak
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9361 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
f35ba8b4f1
commit
cbef00ce1f
|
@ -2226,8 +2226,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
|
|||
mod_sofia_globals.running = 1;
|
||||
switch_mutex_unlock(mod_sofia_globals.mutex);
|
||||
|
||||
switch_queue_create(&mod_sofia_globals.presence_queue, 500000, mod_sofia_globals.pool);
|
||||
switch_queue_create(&mod_sofia_globals.mwi_queue, 500000, mod_sofia_globals.pool);
|
||||
switch_queue_create(&mod_sofia_globals.presence_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
|
||||
switch_queue_create(&mod_sofia_globals.mwi_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
|
||||
|
||||
if (config_sofia(0, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
mod_sofia_globals.running = 0;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
/*************************************************************************************************************************************************************/
|
||||
#define IREG_SECONDS 30
|
||||
#define GATEWAY_SECONDS 1
|
||||
|
||||
#define SOFIA_QUEUE_SIZE 50000
|
||||
#define HAVE_APR
|
||||
#include <switch.h>
|
||||
#include <switch_version.h>
|
||||
|
|
|
@ -358,7 +358,6 @@ void sofia_event_callback(nua_event_t event,
|
|||
nua_handle_bind(nh, NULL);
|
||||
}
|
||||
sofia_private->destroy_me = 12;
|
||||
|
||||
free(sofia_private);
|
||||
sofia_private = NULL;
|
||||
}
|
||||
|
@ -443,7 +442,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
|||
|
||||
sofia_set_pflag_locked(profile, PFLAG_WORKER_RUNNING);
|
||||
|
||||
switch_queue_create(&profile->sql_queue, 500000, profile->pool);
|
||||
switch_queue_create(&profile->sql_queue, SOFIA_QUEUE_SIZE, profile->pool);
|
||||
|
||||
qsize = switch_queue_size(profile->sql_queue);
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@ static int do_rand(void)
|
|||
{
|
||||
double r;
|
||||
int index;
|
||||
srand(getpid() + ++S);
|
||||
unsigned int seed = ++S + getpid();
|
||||
srand(seed);
|
||||
r = ((double) rand() / ((double) (RAND_MAX) + (double) (1)));
|
||||
index = (int) (r * 9) + 1;
|
||||
return index;
|
||||
|
@ -230,7 +231,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
|||
}
|
||||
|
||||
switch_core_timer_destroy(&timer);
|
||||
if (source->shuffle) {
|
||||
if (RUNNING && source->shuffle) {
|
||||
skip = do_rand();
|
||||
}
|
||||
}
|
||||
|
@ -472,6 +473,11 @@ static void launch_threads(void)
|
|||
switch_xml_free(xml);
|
||||
}
|
||||
|
||||
static void event_handler(switch_event_t *event)
|
||||
{
|
||||
RUNNING = 0;
|
||||
}
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_local_stream_load)
|
||||
{
|
||||
switch_file_interface_t *file_interface;
|
||||
|
@ -485,6 +491,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_local_stream_load)
|
|||
file_interface->file_close = local_stream_file_close;
|
||||
file_interface->file_read = local_stream_file_read;
|
||||
|
||||
if (switch_event_bind(modname, SWITCH_EVENT_SHUTDOWN, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind event handler!\n");
|
||||
}
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, pool);
|
||||
switch_core_hash_init(&globals.source_hash, pool);
|
||||
|
|
|
@ -1149,6 +1149,8 @@ SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
|
|||
}
|
||||
}
|
||||
|
||||
switch_yield(1000000);
|
||||
|
||||
for (hi = switch_hash_first(NULL, loadable_modules.module_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &val);
|
||||
module = (switch_loadable_module_t *) val;
|
||||
|
|
Loading…
Reference in New Issue