Files
asterisk/include/asterisk
Richard Mudgett 8dc6345d0f Allow AMI action callback to be reentrant.
Fix AMI module reload deadlock regression from ASTERISK-18479 when it
tried to fix the race between calling an AMI action callback and
unregistering that action.  Refixes ASTERISK-13784 broken by
ASTERISK-17785 change.

Locking the ao2 object guaranteed that there were no active callbacks that
mattered when ast_manager_unregister() was called.  Unfortunately, this
causes the deadlock situation.  The patch stops locking the ao2 object to
allow multiple threads to invoke the callback re-entrantly.  There is no
way to guarantee a module unload will not crash because of an active
callback.  The code attempts to minimize the chance with the registered
flag and the maximum 5 second delay before ast_manager_unregister()
returns.

The trunk version of the patch changes the API to fix the race condition
correctly to prevent the module code from unloading from memory while an
action callback is active.

* Don't hold the lock while calling the AMI action callback.

(closes issue ASTERISK-19487)
Reported by: Philippe Lindheimer

Review: https://reviewboard.asterisk.org/r/1818/
Review: https://reviewboard.asterisk.org/r/1820/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@359979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-20 17:21:16 +00:00
..
2011-02-08 01:45:04 +00:00
2010-06-02 18:10:15 +00:00
2009-04-29 18:53:01 +00:00
2011-06-09 22:29:20 +00:00
2010-06-08 14:38:18 +00:00
2010-07-14 15:48:36 +00:00
2011-12-16 20:55:17 +00:00
2011-09-26 19:30:39 +00:00
2010-09-28 18:18:43 +00:00
2010-09-07 19:38:12 +00:00
2011-09-13 07:11:36 +00:00
2010-04-29 00:35:14 +00:00
2011-12-22 18:38:46 +00:00
2010-06-08 14:38:18 +00:00
2009-03-18 02:28:55 +00:00
2011-11-23 17:12:46 +00:00
2010-09-30 17:50:52 +00:00
2009-06-15 16:07:23 +00:00
2010-07-23 16:19:21 +00:00
2012-02-24 15:07:09 +00:00
2009-01-29 19:34:09 +00:00
2011-10-11 00:43:14 +00:00
2010-06-08 14:38:18 +00:00
2010-06-08 14:38:18 +00:00
2010-06-08 14:38:18 +00:00