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
This commit is contained in:
Richard Mudgett
2011-06-09 16:47:07 +00:00
parent f0deadaf60
commit 0a8f9d2cf0
3 changed files with 93 additions and 46 deletions

View File

@@ -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.
*/