diff options
author | Richard Mudgett <rmudgett@digium.com> | 2011-06-09 16:47:07 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2011-06-09 16:47:07 +0000 |
commit | 0a8f9d2cf0872be7ffc623066c4220de3bdfb97c (patch) | |
tree | 6132cd6991a104993a524ca957535c1f880b5bc8 /include | |
parent | f0deadaf6088889b24748144f64b2a493c8fd071 (diff) |
Merged revisions 322749 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r322749 | rmudgett | 2011-06-09 11:31:53 -0500 (Thu, 09 Jun 2011) | 15 lines
Remove potential deadlock in call pickup race.
Deadlock is possible in ast_do_pickup() when holding the target channel
lock and trying to get the chan channel lock. Also, holding the target
lock when calling ast_channel_masquerade() is not a good idea because that
routine does deadlock avoidance.
* Removed the need to hold the target lock after marking the target with a
datastore and getting the connected line data off of the target channel.
* Moved can_pickup() to ast_can_pickup() in features.c. Now all the call
pickup methods use the same basic call pickup availability check.
Review: https://reviewboard.asterisk.org/r/1234/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/features.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/asterisk/features.h b/include/asterisk/features.h index 4ea941383..7e749f2e0 100644 --- a/include/asterisk/features.h +++ b/include/asterisk/features.h @@ -119,12 +119,28 @@ const char *ast_pickup_ext(void); /*! \brief Bridge a call, optionally allowing redirection */ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config); +/*! + * \brief Test if a channel can be picked up. + * + * \param chan Channel to test if can be picked up. + * + * \note This function assumes that chan is locked. + * + * \return TRUE if channel can be picked up. + */ +int ast_can_pickup(struct ast_channel *chan); + /*! \brief Pickup a call */ int ast_pickup_call(struct ast_channel *chan); /*! - * \brief Pickup a call target - * \note This function assumes that target is locked + * \brief Pickup a call target. + * + * \param chan channel that initiated pickup. + * \param target channel to be picked up. + * + * \note This function assumes that target is locked. + * * \retval 0 on success. * \retval -1 on failure. */ |