aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-20 17:59:00 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-20 17:59:00 +0000
commit8591091cd8d57b9f0db60cd3cb0ec17d3e2d7cc8 (patch)
tree0f0a40ad3d3bd3936a7c119a61321cb67f9d2bfe /main
parent00f85a0666d83661970c8d841bfd381284451eb5 (diff)
Merged revisions 89457 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89457 | mmichelson | 2007-11-20 11:50:31 -0600 (Tue, 20 Nov 2007) | 9 lines According to comments in main/pbx.c, it is essential that if we are going to lock the conlock as well as the hints lock, it must be locked in that respective order. In order to prevent a potential deadlock, we need to lock the conlock prior to locking the hints lock in ast_hint_state_changed (see the call stack example on issue #11323 for how this can happen). (closes issue #11323, reported by eelcob, suggestion for patch by eelcob, patch by me) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89458 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 7262df6d1..cd8a23ca8 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2742,6 +2742,7 @@ static void handle_statechange(const char *device)
{
struct ast_hint *hint;
+ ast_rdlock_contexts();
AST_RWLIST_RDLOCK(&hints);
AST_RWLIST_TRAVERSE(&hints, hint, list) {
@@ -2779,6 +2780,7 @@ static void handle_statechange(const char *device)
}
AST_RWLIST_UNLOCK(&hints);
+ ast_unlock_contexts();
}
static int statechange_queue(const char *dev)