aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-21 23:20:47 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-21 23:20:47 +0000
commitbbe48893444efab43c853655426542587f124e33 (patch)
tree67ae052a8f3b8a7a1232c5bc2da97cae5b293b1b
parenta871e62297540d8d05a48a46d4702a52c9058ead (diff)
Read lock the contexts to maintain the locking order when we are notified that the state of a device has changed.
(closes issue #13839) Reported by: mcallist git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@169867 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/pbx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c
index a1a815046..1cc04f504 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2027,6 +2027,7 @@ void ast_hint_state_changed(const char *device)
{
struct ast_hint *hint;
+ ast_rdlock_contexts();
AST_LIST_LOCK(&hints);
AST_LIST_TRAVERSE(&hints, hint, list) {
@@ -2064,6 +2065,7 @@ void ast_hint_state_changed(const char *device)
}
AST_LIST_UNLOCK(&hints);
+ ast_unlock_contexts();
}
/*! \brief ast_extension_state_add: Add watcher for extension states */