[Asterisk-Dev] chan_h323 Deadlock (current CVS)

Warp warp at panameritel.com
Tue Nov 23 04:33:23 MST 2004


Hi.
Not so long ago i post message about Deadlock on incoming call from h323
network in current chan_h323.

I find error.
In file chan_h323.c function oh323_new.

Current 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_unlock(&pvt->lock);
	ch = ast_channel_alloc(1);
	ast_mutex_lock(&pvt->lock);


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 :))

Have Fun.  






More information about the asterisk-dev mailing list