aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-15 16:54:07 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-15 16:54:07 +0000
commit089b1388cab549cb07f018e06b93a74e06b829ac (patch)
tree1c36d37983153a2dc6e63a51d972910889ce5327
parent2151e5fd29b6644fcf73e0f231759bb4df35d099 (diff)
Merged revisions 291905 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r291905 | twilson | 2010-10-15 09:39:58 -0700 (Fri, 15 Oct 2010) | 14 lines Merged revisions 291904 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r291904 | twilson | 2010-10-15 09:16:57 -0700 (Fri, 15 Oct 2010) | 7 lines Don't crash or deadlock on module unload We can't hold the lock while pthread_join is called since aji_log_hook will attempt to lock from the other therad. We reorder the pthread_join and ast_aji_disconnect so that we don't do an SSL_read() while SSL_shutdown is running, causing a crash. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@291906 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_jabber.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 6b737e70b..0c463f0c6 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -4695,12 +4695,12 @@ static int unload_module(void)
ast_custom_function_unregister(&jabberreceive_function);
ASTOBJ_CONTAINER_TRAVERSE(&clients, 1, {
- ASTOBJ_RDLOCK(iterator);
+ ASTOBJ_WRLOCK(iterator);
ast_debug(3, "JABBER: Releasing and disconnecting client: %s\n", iterator->name);
iterator->state = AJI_DISCONNECTING;
- ast_aji_disconnect(iterator);
- pthread_join(iterator->thread, NULL);
ASTOBJ_UNLOCK(iterator);
+ pthread_join(iterator->thread, NULL);
+ ast_aji_disconnect(iterator);
});
ASTOBJ_CONTAINER_DESTROYALL(&clients, aji_client_destroy);