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
{
struct ast_hint *hint;
struct statechange *sc = datap;
+
+ ast_rdlock_contexts();
AST_RWLIST_RDLOCK(&hints);
AST_RWLIST_TRAVERSE(&hints, hint, list) {
hint->laststate = state; /* record we saw the change */
}
AST_RWLIST_UNLOCK(&hints);
+ ast_unlock_contexts();
ast_free(sc);
return 0;
}