Posted: Tue Nov 23, 2004 3:28 am Post subject: [Asterisk-Dev] chan_h323 Deadlock (current CVS)
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 :))
Posted: Tue Nov 23, 2004 1:16 pm Post subject: [Asterisk-Dev] chan_h323 Deadlock (current CVS)
On Tue, Nov 23, 2004 at 02:33:23PM +0300, Warp wrote:
Quote:
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.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum