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:57:21 -0500
commit6c555891eb429512ae98925fc9bbd12f0b516d8c (patch)
treef975c3aab31b41534719cca8493f1be4c53186b1 /tests
parentb7c27e1c84c430093961439e5d2a955a9c4f7d81 (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);