asterisk/res
David M. Lee b97c71bb11 Fix shutdown assertions in stasis-core
In r388005, macros were introduced to consistently define message
types. This added an assert if a message type was used either before
it was initialized or after it had been cleaned up. It turns out that
this assertion fires during shutdown.

This actually exposed a hidden shutdown ordering problem. Since
unsubscribing is asynchronous, it's possible that the message types
used by the subscription could be freed before the final message of
the subscription was processed.

This patch adds stasis_subscription_join(), which blocks until the
last message has been processed by the subscription. Since joining was
most commonly done right after an unsubscribe, a
stasis_unsubscribe_and_join() convenience function was also added.

Similar functions were also added to the stasis_caching_topic and
stasis_message_router, since they wrap subscriptions and have similar
problems.

Other code in trunk was refactored to join() where appropriate, or at
least verify that the subscription was complete before being
destroyed.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17 21:10:32 +00:00
..
ael Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
res_sip Stasis: Update security events to use Stasis 2013-05-17 17:36:10 +00:00
snmp Add The Status Of A Module To The Output Of "CLI> module show" 2013-02-19 17:17:10 +00:00
stasis Fixed inverted logic in app_add_channel(). 2013-05-15 21:13:29 +00:00
stasis_http Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
stasis_json Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
Makefile Break res_stasis into smaller files. 2013-05-14 21:45:08 +00:00
res_adsi.c Multiple revisions 369323-369324 2012-06-25 15:55:25 +00:00
res_ael_share.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_ael_share.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_agi.c Fix FastAGI To Properly Check For A Connection 2013-02-22 19:40:02 +00:00
res_agi.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_calendar.c Prevent exhaustion of system resources through exploitation of event cache 2013-01-02 18:11:59 +00:00
res_calendar.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_calendar_caldav.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
res_calendar_ews.c Properly extract the Body information of an EWS calendar item 2012-10-31 14:58:44 +00:00
res_calendar_exchange.c Add uuid wrapper API call ast_uuid_generate_str(). 2013-03-28 23:59:20 +00:00
res_calendar_icalendar.c Fix memory leak in res_calendar_icalendar 2013-01-30 14:19:29 +00:00
res_chan_stats.c Fix shutdown assertions in stasis-core 2013-05-17 21:10:32 +00:00
res_clialiases.c The UUID commit removed changes made in res_clialiases.c 2012-12-13 15:37:45 +00:00
res_clioriginate.c Allow support for early media on AMI originates and call files. 2012-08-08 22:39:40 +00:00
res_config_curl.c Add support for a realtime sorcery module. 2013-04-27 12:01:29 +00:00
res_config_ldap.c Add support for a realtime sorcery module. 2013-04-27 12:01:29 +00:00
res_config_odbc.c Fix Finding Extensions With Patterns Using ODBC Realtime 2013-05-10 20:28:18 +00:00
res_config_pgsql.c Minor fixups to Doxygen comments. 2013-05-07 18:30:55 +00:00
res_config_sqlite.c Update res_config_sqlite to use the ast_variable lists. 2013-04-27 16:17:01 +00:00
res_config_sqlite3.c Add support for a realtime sorcery module. 2013-04-27 12:01:29 +00:00
res_convert.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_corosync.c Allow res_corosync to build 2013-04-16 17:50:14 +00:00
res_crypto.c Doxygen Updates - janitor work 2012-09-21 17:14:59 +00:00
res_crypto.exports.in Remove built-in AES code and use optional_api instead 2010-07-21 19:11:32 +00:00
res_curl.c Doxygen Updates - Title update 2012-10-14 21:44:27 +00:00
res_fax.c Ensure ReceiveFax provides a CED tone via T.38 2012-12-10 16:56:37 +00:00
res_fax.exports.in Log spandsp's fax debug output to the FAX logger level. 2010-05-21 15:15:58 +00:00
res_fax_spandsp.c res_fax_spandsp: fix t38 transmission bug caused by not returning success 2013-01-22 22:19:02 +00:00
res_format_attr_celt.c Add support for parsing SDP attributes, generating SDP attributes, and passing it through. 2012-07-13 16:49:40 +00:00
res_format_attr_h263.c Reduce memory consumption and add the H.264 and H.263 modules I shamefully neglected to add. 2012-07-13 18:41:07 +00:00
res_format_attr_h264.c AST-2013-001: Prevent buffer overflow through H.264 format negotiation 2013-03-27 14:28:36 +00:00
res_format_attr_silk.c Add support for parsing SDP attributes, generating SDP attributes, and passing it through. 2012-07-13 16:49:40 +00:00
res_http_post.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
res_http_websocket.c Allow WebSocket connections on more URL's 2013-04-18 17:30:28 +00:00
res_http_websocket.exports.in Fix an issue with res_http_websocket where the chan_sip WebSocket handler could not be registered. 2012-10-31 18:01:09 +00:00
res_jabber.c Fix shutdown assertions in stasis-core 2013-05-17 21:10:32 +00:00
res_jabber.exports.in Fix chan_jingle/gtalk load regression introduced in r346087 2011-12-05 14:47:11 +00:00
res_limit.c Doxygen Updates - Title update 2012-10-14 21:44:27 +00:00
res_monitor.c Resolve FORWARD_NULL static analysis warnings 2012-05-10 20:56:09 +00:00
res_monitor.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_musiconhold.c Refactor ast_timer_ack to return an error and handle the error in timer users 2012-11-05 23:10:14 +00:00
res_mutestream.c Fix the svn:keywords property on several files. 2013-04-15 16:10:10 +00:00
res_odbc.c Doxygen Updates - Title update 2012-10-14 21:44:27 +00:00
res_odbc.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_phoneprov.c Doxygen Updates - Title update 2012-10-14 21:44:27 +00:00
res_pktccops.c Multiple revisions 350788-350789 2012-01-14 15:51:43 +00:00
res_pktccops.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_realtime.c Cleanup references to sipusers and sipfriends dynamic realtime families 2011-11-01 19:53:26 +00:00
res_rtp_asterisk.c Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit 2013-05-09 04:11:59 +00:00
res_rtp_multicast.c Calculate the timestamp for outbound RTP if we don't have timing information 2013-04-14 03:01:33 +00:00
res_security_log.c Stasis: Update security events to use Stasis 2013-05-17 17:36:10 +00:00
res_sip.c Stasis: Update security events to use Stasis 2013-05-17 17:36:10 +00:00
res_sip.exports.in Merge the pimp_my_sip branch into trunk. 2013-04-25 18:25:31 +00:00
res_sip_acl.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_authenticator_digest.c Merge the pimp_my_sip branch into trunk. 2013-04-25 18:25:31 +00:00
res_sip_caller_id.c Merge the pimp_my_sip branch into trunk. 2013-04-25 18:25:31 +00:00
res_sip_dtmf_info.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_endpoint_identifier_constant.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_endpoint_identifier_ip.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_endpoint_identifier_user.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_logger.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_mwi.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_nat.c Stasis: Update security events to use Stasis 2013-05-17 17:36:10 +00:00
res_sip_outbound_authenticator_digest.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_outbound_registration.c Stasis: Update security events to use Stasis 2013-05-17 17:36:10 +00:00
res_sip_pubsub.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_pubsub.exports.in Merge the pimp_my_sip branch into trunk. 2013-04-25 18:25:31 +00:00
res_sip_registrar.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_rfc3326.c Add missing module dependencies to various res_sip* modules 2013-04-26 21:52:06 +00:00
res_sip_sdp_rtp.c Use the configured formats for Gulp sessions if there are no joint formats between requested formats and configured formats. 2013-05-03 11:35:14 +00:00
res_sip_session.c Merge the pimp_my_sip branch into trunk. 2013-04-25 18:25:31 +00:00
res_sip_session.exports.in Merge the pimp_my_sip branch into trunk. 2013-04-25 18:25:31 +00:00
res_smdi.c Doxygen Updates - Title update 2012-10-14 21:44:27 +00:00
res_smdi.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_snmp.c Doxygen Updates - Title update 2012-10-14 21:44:27 +00:00
res_sorcery_astdb.c Add support for observers and JSON objectset creation to sorcery. 2013-05-06 13:04:08 +00:00
res_sorcery_config.c Merge the pimp_my_sip branch into trunk. 2013-04-25 18:25:31 +00:00
res_sorcery_memory.c Pass the sorcery instance to wizards for CUD operations as well as retrieve. 2013-03-20 14:52:23 +00:00
res_sorcery_realtime.c Add support for a realtime sorcery module. 2013-04-27 12:01:29 +00:00
res_speech.c Add support for retrieving engine specific settings using the speech API and from dialplan. 2012-10-01 12:29:04 +00:00
res_speech.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_srtp.c Use srtp_shutdown when available 2013-05-15 12:42:04 +00:00
res_srtp.exports.in Add SRTP support for Asterisk 2010-06-08 05:29:08 +00:00
res_stasis.c Fix shutdown assertions in stasis-core 2013-05-17 21:10:32 +00:00
res_stasis.exports.in Moved core logic from app_stasis to res_stasis 2013-04-15 16:43:47 +00:00
res_stasis_answer.c Break res_stasis into smaller files. 2013-05-14 21:45:08 +00:00
res_stasis_http.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_http.exports.in This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
res_stasis_http_asterisk.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_http_bridges.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_http_channels.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_http_endpoints.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_http_events.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_http_playback.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_http_recordings.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_http_sounds.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_stasis_json_asterisk.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_asterisk.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_bridges.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_bridges.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_channels.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_channels.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_endpoints.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_endpoints.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_events.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_events.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_playback.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_playback.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_recordings.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_recordings.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_sounds.c Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_json_sounds.exports.in Move JSON event generators into separate modules 2013-05-14 12:47:52 +00:00
res_stasis_test.c Refactored the rest of the message types to use the STASIS_MESSAGE_TYPE_* 2013-05-15 02:37:22 +00:00
res_stasis_test.exports.in Initial support for endpoints. 2013-05-08 13:39:08 +00:00
res_stasis_websocket.c Address unload order issues for res_stasis* modules 2013-05-10 17:12:57 +00:00
res_statsd.c Example of how to use the Stasis message bus 2013-04-26 20:05:15 +00:00
res_statsd.exports.in Example of how to use the Stasis message bus 2013-04-26 20:05:15 +00:00
res_stun_monitor.c Stasis: Convert network change events into network change stasis messages 2013-05-03 18:03:26 +00:00
res_timing_dahdi.c Refactor ast_timer_ack to return an error and handle the error in timer users 2012-11-05 23:10:14 +00:00
res_timing_kqueue.c Refactor ast_timer_ack to return an error and handle the error in timer users 2012-11-05 23:10:14 +00:00
res_timing_pthread.c Prevent res_timing_pthread from blocking callers 2013-04-19 22:27:08 +00:00
res_timing_timerfd.c Refactor ast_timer_ack to return an error and handle the error in timer users 2012-11-05 23:10:14 +00:00
res_xmpp.c res_xmpp and res_jabber need to search 'cachable' in the attrib section of the received IE, not data. 2013-04-16 23:44:18 +00:00
res_xmpp.exports.in Add a new unified Jingle, Google Jingle, and Google Talk channel driver written from scratch called chan_motif. 2012-07-07 17:06:51 +00:00
stasis_http.make This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00