]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix race condition for CEL LINKEDID_END event
authorTerry Wilson <twilson@digium.com>
Tue, 22 May 2012 17:21:51 +0000 (17:21 +0000)
committerTerry Wilson <twilson@digium.com>
Tue, 22 May 2012 17:21:51 +0000 (17:21 +0000)
commit6900424762f577fe7168e65a39437ce92432a0bb
tree36b0f96cac3cb37caf1fa40b1f9c382144765221
parent72569b9159412bb6e97dd8e5f22a6f47fa0bf0ef
Fix race condition for CEL LINKEDID_END event

This patch fixes to situations that could cause the CEL LINKEDID_END event to
be missed.

1) During a core stop gracefully, modules are unloaded when ast_active_channels
== 0. The LINKDEDID_END event fires during the channel destructor. This means
that occasionally, the cel_* module will be unloaded before the channel is
destroyed. It seemed generally useful to wait until the refcount of all
channels == 0 before unloading, so I added a channel counter and used it in the
shutdown code.

2) During a masquerade, ast_channel_change_linkedid is called. It calls
ast_cel_check_retire_linkedid which unrefs the linkedid in the linkedids
container in cel.c. It didn't ref the new linkedid. Now it does.

Review: https://reviewboard.asterisk.org/r/1900/
........

Merged revisions 367292 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@367299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/cel.h
include/asterisk/channel.h
main/asterisk.c
main/cel.c
main/channel.c