asterisk: Audit locking of channel when manipulating flags.

When manipulating flags on a channel the channel has to be
locked to guarantee that nothing else is also manipulating
the flags. This change introduces locking where necessary to
guarantee this. It also adds helper functions that manipulate
channel flags and lock to reduce repeated code.

ASTERISK-26789

Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
This commit is contained in:
Joshua Colp
2017-05-13 16:40:00 +00:00
parent 6383d9214a
commit 1618203964
15 changed files with 96 additions and 55 deletions

View File

@@ -300,11 +300,11 @@ int ast_autoservice_stop(struct ast_channel *chan)
res = 0;
}
ast_channel_lock(chan);
if (!as->orig_end_dtmf_flag) {
ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
}
ast_channel_lock(chan);
while ((f = AST_LIST_REMOVE_HEAD(&as->deferred_frames, frame_list))) {
if (!((1 << f->frametype) & as->ignore_frame_types)) {
ast_queue_frame_head(chan, f);