From 376d85f96cd3221873c2bb1ef1f6a9bc7d0b0020 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Wed, 21 Jan 2009 23:20:47 +0000 Subject: [PATCH] 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/branches/1.4@169867 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/pbx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/pbx.c b/main/pbx.c index a1a8150460..1cc04f504f 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 */