aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-19 19:14:58 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-19 19:14:58 +0000
commit2085f312d96a8130b361498199ddaeb01a8ebda5 (patch)
tree0454abead1f3f0ea72657c0d7a58aafca4c1887f /channels
parent9d16bb6660a813f2d763df8c2396a49004e986b3 (diff)
Merged revisions 83175 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83175 | russell | 2007-09-19 14:13:29 -0500 (Wed, 19 Sep 2007) | 8 lines When handling a reload of chan_iax2, don't use an ao2_callback() to POKE all peers. Instead, use an iterator. By using an iterator, the peers container is not locked while the POKE is being done. It can cause a deadlock if the peers container is locked because poking a peer will try to lock pvt structs, while there is a lot of other code that will hold a pvt lock when trying to go lock the peers container. (reported to me directly by Loic Didelot. Thank you for the debug info!) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83176 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index f7f063a4b..4bd1ace8a 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -10368,6 +10368,17 @@ static int set_config(char *config_file, int reload)
return 1;
}
+static void poke_all_peers(void)
+{
+ struct ao2_iterator i;
+ struct iax2_peer *peer;
+
+ i = ao2_iterator_init(peers, 0);
+ while ((peer = ao2_iterator_next(&i))) {
+ iax2_poke_peer(peer, 0);
+ peer_unref(peer);
+ }
+}
static int reload_config(void)
{
char *config = "iax.conf";
@@ -10385,9 +10396,9 @@ static int reload_config(void)
AST_LIST_UNLOCK(&registrations);
/* Qualify hosts, too */
- ao2_callback(peers, 0, iax2_poke_peer_cb, NULL);
+ poke_all_peers();
}
-
+
reload_firmware(0);
iax_provision_reload(1);