mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-19 01:45:32 +00:00
back off locking contention so you can query for other interfaces while a module is loading that locks the interfaces hash
This commit is contained in:
parent
316414b9ec
commit
47f997a050
@ -994,8 +994,8 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn
|
||||
switch_snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
|
||||
}
|
||||
|
||||
switch_mutex_lock(loadable_modules.mutex);
|
||||
if (switch_core_hash_find(loadable_modules.module_hash, file)) {
|
||||
|
||||
if (switch_core_hash_find_locked(loadable_modules.module_hash, file, loadable_modules.mutex)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Module %s Already Loaded!\n", file);
|
||||
*err = "Module already loaded";
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
@ -1010,7 +1010,7 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn
|
||||
} else {
|
||||
*err = "module load file routine returned an error";
|
||||
}
|
||||
switch_mutex_unlock(loadable_modules.mutex);
|
||||
|
||||
|
||||
return status;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user