Merged revisions 169867 via svnmerge from
[asterisk/asterisk.git] / main / pbx.c
index b62314a..1e04013 100644 (file)
@@ -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;
 }