mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-28 15:11:12 +00:00
res_stasis: Add control ref to playback and recording structs.
The stasis_app_playback and stasis_app_recording structs need to have a struct stasis_app_control ref. Other threads can get a reference to the playback and recording structs from their respective global container. These other threads can then use the control pointer they contain after the control struct has gone. * Add control ref to stasis_app_playback and stasis_app_recording structs. With the refs added, the control command queue can now have a circular control reference which will cause the control struct to never get released if the control's command queue is not flushed when the channel leaves the Stasis application. Also the command queue needs better protection from adding commands if the control->is_done flag is set. * Flush the control command queue on exit. ASTERISK-25882 #close Change-Id: I3cf1fb59cbe6f50f20d9e35a2c07ac07d7f4320d
This commit is contained in:
@@ -439,6 +439,16 @@ void stasis_app_control_execute_until_exhausted(
|
||||
int stasis_app_control_is_done(
|
||||
struct stasis_app_control *control);
|
||||
|
||||
/*!
|
||||
* \brief Flush the control command queue.
|
||||
* \since 13.9.0
|
||||
*
|
||||
* \param control Control object to flush command queue.
|
||||
*
|
||||
* \return Nothing
|
||||
*/
|
||||
void stasis_app_control_flush_queue(struct stasis_app_control *control);
|
||||
|
||||
/*!
|
||||
* \brief Returns the uniqueid of the channel associated with this control
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user