mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-09-22 04:15:54 -04:00
Removed lock/unlock on config for master updates
At this point is it more for ease than anything else. The locks could be released quickly with some effort.
This commit is contained in:
parent
a6490be231
commit
85a09dac6a
10
src/slave.c
10
src/slave.c
@ -625,7 +625,6 @@ static int update_from_master(master_server *master)
|
||||
if (master->password == NULL || master->server == NULL || master->port == 0)
|
||||
break;
|
||||
ret = 1;
|
||||
config_release_config();
|
||||
mastersock = sock_connect_wto(master->server, master->port, 10);
|
||||
|
||||
if (mastersock == SOCK_ERROR)
|
||||
@ -784,16 +783,17 @@ static void *_slave_thread(void *arg)
|
||||
max_interval = config->master_update_interval;
|
||||
thread_mutex_unlock(&_slave_mutex);
|
||||
|
||||
/* update all non-legacy master servers */
|
||||
/* update all non-legacy master servers. the config lock is being
|
||||
* held for the entire update process. consider making a copy of
|
||||
* the master linked list and releasing the lock */
|
||||
master = config->master;
|
||||
while (master) {
|
||||
update_from_master(master);
|
||||
master = master->next;
|
||||
}
|
||||
|
||||
/* the connection could take some time, so the lock can drop */
|
||||
if (update_from_master_legacy (config))
|
||||
config = config_get_config();
|
||||
/* update legacy master server */
|
||||
update_from_master_legacy (config);
|
||||
|
||||
thread_mutex_lock (&(config_locks()->relay_lock));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user