summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2009-01-21 23:25:27 +0000
committerJoshua Colp <jcolp@digium.com>2009-01-21 23:25:27 +0000
commit99f31b91cf909e3a8bedd06506da2ef1b6fd9b59 (patch)
tree41b9cbba4aa9ba8a8a0252d004d1fd55b15ff7a8
parentf6bb99a5c5dee89e42d419a0e0dff3cedc9c52a1 (diff)
Merged revisions 169867 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r169867 | file | 2009-01-21 19:20:47 -0400 (Wed, 21 Jan 2009) | 4 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@169869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/pbx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c
index b62314ade..1e0401373 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -3774,6 +3774,8 @@ static int handle_statechange(void *datap)
{
struct ast_hint *hint;
struct statechange *sc = datap;
+
+ ast_rdlock_contexts();
AST_RWLIST_RDLOCK(&hints);
AST_RWLIST_TRAVERSE(&hints, hint, list) {
@@ -3812,6 +3814,7 @@ static int handle_statechange(void *datap)
hint->laststate = state; /* record we saw the change */
}
AST_RWLIST_UNLOCK(&hints);
+ ast_unlock_contexts();
ast_free(sc);
return 0;
}