mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
stream: Make the topology a reference counted object.
The stream topology has no lock of its own resulting in another lock protecting it in some way (for example the channel lock). If multiple channels are being juggled at the same time this can be problematic. This change makes the topology a reference counted object instead which guarantees it will remain valid even without the channel lock being held. Change-Id: I4f4d3dd856a033ed55fe218c3a4fab364afedb03
This commit is contained in:
@@ -2159,15 +2159,7 @@ static void softmix_bridge_stream_topology_changed(struct ast_bridge *bridge, st
|
||||
ast_bridge_channel_lock(participant);
|
||||
ast_channel_lock(participant->chan);
|
||||
|
||||
topology = ast_channel_get_stream_topology(participant->chan);
|
||||
if (topology) {
|
||||
/*
|
||||
* Sigh. We have to clone to avoid deadlock in
|
||||
* map_source_to_destinations() because topology
|
||||
* is not an ao2 object.
|
||||
*/
|
||||
topology = ast_stream_topology_clone(topology);
|
||||
}
|
||||
topology = ao2_bump(ast_channel_get_stream_topology(participant->chan));
|
||||
if (!topology) {
|
||||
/* Oh, my, we are in trouble. */
|
||||
ast_channel_unlock(participant->chan);
|
||||
|
Reference in New Issue
Block a user