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
This commit is contained in:
Joshua Colp
2009-01-21 23:20:47 +00:00
parent 9db9bae4d9
commit 376d85f96c

View File

@@ -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 */