[asterisk-dev] [asterisk-commits] mmichelson: branch certified-1.8.15 r372884 - in /certified/branches/1.8.15: ...
Alec Davis
sivad.a at paradise.net.nz
Wed Sep 12 15:41:11 CDT 2012
Doesn't this apply to 1.8 as well.
I didn't see a 1.8 commit?
Alec
> -----Original Message-----
> From: asterisk-commits-bounces at lists.digium.com
> [mailto:asterisk-commits-bounces at lists.digium.com] On Behalf
> Of SVN commits to the Asterisk project
> Sent: Wednesday, 12 September 2012 9:03 a.m.
> To: asterisk-commits at lists.digium.com; svn-commits at lists.digium.com
> Subject: [asterisk-commits] mmichelson: branch
> certified-1.8.15 r372884 - in /certified/branches/1.8.15: ...
>
> Author: mmichelson
> Date: Tue Sep 11 16:02:33 2012
> New Revision: 372884
>
> URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=372884
> Log:
> Fix inability to shutdown gracefully due to an unending
> channel reference.
>
> message.c makes use of a special message queue channel that
> exists in thread storage. This channel never goes away due to
> the fact that the taskprocessor used by message.c does not
> get shut down, meaning that it never ends the thread that
> stores the channel.
>
> This patch fixes the problem by shutting down the
> taskprocessor when Asterisk is shut down. In addition, the
> thread storage has a destructor that will release the channel
> reference when the taskprocessor is destroyed.
>
> (closes issue AST-937)
> Reported by Jason Parker
> Patches:
> AST-937.patch uploaded by Mark Michelson (License
> #5049) Tested by Jason Parker
>
>
> Modified:
> certified/branches/1.8.15/include/asterisk/_private.h
> certified/branches/1.8.15/main/asterisk.c
> certified/branches/1.8.15/main/message.c
>
> Modified: certified/branches/1.8.15/include/asterisk/_private.h
> URL:
> http://svnview.digium.com/svn/asterisk/certified/branches/1.8.
> 15/include/asterisk/_private.h?view=diff&rev=372884&r1=372883&
r2=372884
> ==============================================================
> ================
> --- certified/branches/1.8.15/include/asterisk/_private.h (original)
> +++ certified/branches/1.8.15/include/asterisk/_private.h Tue Sep 11
> +++ 16:02:33 2012
> @@ -48,6 +48,7 @@
> int ast_ssl_init(void); /*!< Provided by ssl.c */
> int ast_test_init(void); /*!< Provided by test.c */
> int ast_msg_init(void); /*!< Provided by message.c */
> +void ast_msg_shutdown(void); /*!< Provided by message.c */
>
> /*!
> * \brief Reload asterisk modules.
>
> Modified: certified/branches/1.8.15/main/asterisk.c
> URL:
> http://svnview.digium.com/svn/asterisk/certified/branches/1.8.
> 15/main/asterisk.c?view=diff&rev=372884&r1=372883&r2=372884
> ==============================================================
> ================
> --- certified/branches/1.8.15/main/asterisk.c (original)
> +++ certified/branches/1.8.15/main/asterisk.c Tue Sep 11 16:02:33 2012
> @@ -1687,6 +1687,7 @@
> * (if in batch mode). really_quit happens to call it
> again when running
> * the atexit handlers, otherwise this would be a bit early. */
> ast_cdr_engine_term();
> + ast_msg_shutdown();
>
> if (niceness == SHUTDOWN_NORMAL) {
> time_t s, e;
>
> Modified: certified/branches/1.8.15/main/message.c
> URL:
> http://svnview.digium.com/svn/asterisk/certified/branches/1.8.
> 15/main/message.c?view=diff&rev=372884&r1=372883&r2=372884
> ==============================================================
> ================
> --- certified/branches/1.8.15/main/message.c (original)
> +++ certified/branches/1.8.15/main/message.c Tue Sep 11 16:02:33 2012
> @@ -743,7 +743,18 @@
> ast_channel_unlock(chan);
> }
>
> -AST_THREADSTORAGE(msg_q_chan);
> +static void destroy_msg_q_chan(void *data) {
> + struct ast_channel **chan = data;
> +
> + if (!*chan) {
> + return;
> + }
> +
> + ast_channel_release(*chan);
> +}
> +
> +AST_THREADSTORAGE_CUSTOM(msg_q_chan, NULL, destroy_msg_q_chan);
>
> /*!
> * \internal
> @@ -1305,3 +1316,8 @@
>
> return res;
> }
> +
> +void ast_msg_shutdown(void)
> +{
> + msg_q_tp = ast_taskprocessor_unreference(msg_q_tp);
> +}
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-commits mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-commits
More information about the asterisk-dev
mailing list