[Asterisk-Dev] chan_h323 Deadlock (current CVS)
Edwin Groothuis
edwin at mavetju.org
Tue Nov 23 14:16:52 MST 2004
On Tue, Nov 23, 2004 at 02:33:23PM +0300, Warp wrote:
> My Code:
> static struct ast_channel *oh323_new(struct oh323_pvt *pvt,
> int state, const char *host)
> {
> struct ast_channel *ch;
> int fmt;
>
> /* Don't hold a oh323_pvt lock while we allocate a chanel */
> ast_mutex_lock(&pvt->lock);
> ch = ast_channel_alloc(1);
> ast_mutex_unlock(&pvt->lock);
>
> Problem its ast_mutex_lock(&pvt->lock); i think must be first
> ast_mutex_lock then ast_mutex_unlock, but I precisely am not confident,
> developers should know it precisely :))
I'm not saying I understand why your deadlock, but according to the
comment above it the code is right.
Edwin
--
Edwin Groothuis | Personal website: http://www.mavetju.org
edwin at mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
More information about the asterisk-dev
mailing list