summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-08-11 16:31:45 -0500
committerRichard Mudgett <rmudgett@digium.com>2017-08-22 11:59:49 -0500
commit9c70c883697d63e6f16b0b06b688a6131423c7e1 (patch)
tree9993f85fd8ae520f7942479b42f5d0759b4073e3 /tests
parentc86619bab87d348cbcd2f3378e4b68c8cb20090b (diff)
channel: Fix topology API locking.
* ast_channel_request_stream_topology_change() must not be called with any channel locks held. * ast_channel_stream_topology_changed() must be called with only the passed channel lock held. ASTERISK-27212 Change-Id: I843de7956d9f1cc7cc02025aea3463d8fe19c691
Diffstat (limited to 'tests')
-rw-r--r--tests/test_stream.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_stream.c b/tests/test_stream.c
index 28983e05c..8c887048c 100644
--- a/tests/test_stream.c
+++ b/tests/test_stream.c
@@ -1768,7 +1768,9 @@ AST_TEST_DEFINE(stream_topology_change_request_from_application_non_multistream)
ast_test_validate_cleanup(test, change_res == -1, res, done);
ast_test_validate_cleanup(test, !pvt->indicated_change_request, res, done);
+ ast_channel_lock(mock_channel);
change_res = ast_channel_stream_topology_changed(mock_channel, topology);
+ ast_channel_unlock(mock_channel);
ast_test_validate_cleanup(test, change_res == -1, res, done);
ast_test_validate_cleanup(test, !pvt->indicated_changed, res, done);
@@ -1876,7 +1878,9 @@ AST_TEST_DEFINE(stream_topology_change_request_from_application)
ast_test_validate_cleanup(test, !change_res, res, done);
ast_test_validate_cleanup(test, pvt->indicated_change_request, res, done);
+ ast_channel_lock(mock_channel);
change_res = ast_channel_stream_topology_changed(mock_channel, topology);
+ ast_channel_unlock(mock_channel);
ast_test_validate_cleanup(test, !change_res, res, done);
ast_test_validate_cleanup(test, pvt->indicated_changed, res, done);