From dbf61acd1f3b3d69f2c6dbcf2e2d5ad87e1d2873 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Wed, 21 Jan 2009 23:27:19 +0000 Subject: [PATCH] Merged revisions 169869 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r169869 | file | 2009-01-21 19:25:27 -0400 (Wed, 21 Jan 2009) | 11 lines 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/branches/1.6.0@169870 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 28e67a2c9a..b28c1fbdb5 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -3267,6 +3267,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) { @@ -3304,6 +3305,7 @@ static void handle_statechange(const char *device) } AST_RWLIST_UNLOCK(&hints); + ast_unlock_contexts(); } static int statechange_queue(const char *dev)