summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-04-11 12:43:34 +0000
committerKinsey Moore <kmoore@digium.com>2014-04-11 12:43:34 +0000
commitd6e2c50058de41eb80d7abc27786825cb65ddccf (patch)
tree1070269c9ad4edfc57a420b648c75a5408f4372f /include
parentf65dd23bf4fbb1cb909755ac3d36fc6aa9f709bb (diff)
bridging: Ensure locking during snapshot creation
While the vast majority of bridge snapshot creation is locked properly, there are currently some instances that are not. This adds the missing locking to ensure bridge state is not malleable during snapshot creation. (closes issue ASTERISK-22904) Review: https://reviewboard.asterisk.org/r/3415/ Reported by: Matt Jordan ........ Merged revisions 412193 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/stasis_bridges.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/asterisk/stasis_bridges.h b/include/asterisk/stasis_bridges.h
index 72bf59948..49d4db2f7 100644
--- a/include/asterisk/stasis_bridges.h
+++ b/include/asterisk/stasis_bridges.h
@@ -65,6 +65,8 @@ struct ast_bridge_snapshot {
* \brief Generate a snapshot of the bridge state. This is an ao2 object, so
* ao2_cleanup() to deallocate.
*
+ * \pre Bridge is locked
+ *
* \param bridge The bridge from which to generate a snapshot
*
* \retval AO2 refcounted snapshot on success
@@ -136,6 +138,8 @@ struct stasis_cache *ast_bridge_cache(void);
* \since 12
* \brief Publish the state of a bridge
*
+ * \pre Bridge is locked
+ *
* \param bridge The bridge for which to publish state
*/
void ast_bridge_publish_state(struct ast_bridge *bridge);
@@ -158,6 +162,8 @@ struct stasis_message_type *ast_bridge_merge_message_type(void);
* \since 12
* \brief Publish a bridge merge
*
+ * \pre Bridges involved are locked
+ *
* \param to The bridge to which channels are being added
* \param from The bridge from which channels are being removed
*/
@@ -281,7 +287,7 @@ struct stasis_message_type *ast_blind_transfer_type(void);
/*!
* \brief Publish a blind transfer event
*
- * \pre No channels or bridges are locked
+ * \pre Bridges involved are locked. Channels involved are not locked.
*
* \param is_external Whether the blind transfer was initiated externally (e.g. via AMI or native protocol)
* \param result The success or failure of the transfer
@@ -346,7 +352,7 @@ struct stasis_message_type *ast_attended_transfer_type(void);
* Publish an \ref ast_attended_transfer_message with the dest_type set to
* \c AST_ATTENDED_TRANSFER_DEST_FAIL.
*
- * \pre No channels or bridges are locked
+ * \pre Bridges involved are locked. Channels involved are not locked.
*
* \param is_external Indicates if the transfer was initiated externally
* \param result The result of the transfer. Will always be a type of failure.
@@ -369,7 +375,7 @@ void ast_bridge_publish_attended_transfer_fail(int is_external, enum ast_transfe
*
* In either case, two bridges enter, one leaves.
*
- * \pre No channels or bridges are locked
+ * \pre Bridges involved are locked. Channels involved are not locked.
*
* \param is_external Indicates if the transfer was initiated externally
* \param result The result of the transfer.
@@ -390,7 +396,7 @@ void ast_bridge_publish_attended_transfer_bridge_merge(int is_external, enum ast
* this results from merging two bridges together. The difference is that a
* transferer channel survives the bridge merge
*
- * \pre No channels or bridges are locked
+ * \pre Bridges involved are locked. Channels involved are not locked.
*
* \param is_external Indicates if the transfer was initiated externally
* \param result The result of the transfer.
@@ -413,7 +419,7 @@ void ast_bridge_publish_attended_transfer_threeway(int is_external, enum ast_tra
* \li A transferee channel leaving a bridge to run an app
* \li A bridge of transferees running an app (via a local channel)
*
- * \pre No channels or bridges are locked
+ * \pre Bridges involved are locked. Channels involved are not locked.
*
* \param is_external Indicates if the transfer was initiated externally
* \param result The result of the transfer.
@@ -438,7 +444,7 @@ void ast_bridge_publish_attended_transfer_app(int is_external, enum ast_transfer
* When this type of transfer occurs, the two bridges continue to exist after the
* transfer and a local channel is used to link the two bridges together.
*
- * \pre No channels or bridges are locked
+ * \pre Bridges involved are locked. Channels involved are not locked.
*
* \param is_external Indicates if the transfer was initiated externally
* \param result The result of the transfer.