From 8085f4e14b6a3d164079f192cc8016048f419442 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Sat, 29 Apr 2006 14:50:18 +0000 Subject: a bunch of conversion to ast_channel_*lock (issue #7058) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23355 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- udptl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'udptl.c') diff --git a/udptl.c b/udptl.c index 25587d90d..045c89d8f 100644 --- a/udptl.c +++ b/udptl.c @@ -996,24 +996,24 @@ int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, void *pvt1; int to; - ast_mutex_lock(&c0->lock); - while (ast_mutex_trylock(&c1->lock)) { - ast_mutex_unlock(&c0->lock); + ast_channel_lock(c0); + while (ast_channel_trylock(c1)) { + ast_channel_unlock(c0); usleep(1); - ast_mutex_lock(&c0->lock); + ast_channel_lock(c0); } pr0 = get_proto(c0); pr1 = get_proto(c1); if (!pr0) { ast_log(LOG_WARNING, "Can't find native functions for channel '%s'\n", c0->name); - ast_mutex_unlock(&c0->lock); - ast_mutex_unlock(&c1->lock); + ast_channel_unlock(c0); + ast_channel_unlock(c1); return -1; } if (!pr1) { ast_log(LOG_WARNING, "Can't find native functions for channel '%s'\n", c1->name); - ast_mutex_unlock(&c0->lock); - ast_mutex_unlock(&c1->lock); + ast_channel_unlock(c0); + ast_channel_unlock(c1); return -1; } pvt0 = c0->tech_pvt; @@ -1022,8 +1022,8 @@ int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, p1 = pr1->get_udptl_info(c1); if (!p0 || !p1) { /* Somebody doesn't want to play... */ - ast_mutex_unlock(&c0->lock); - ast_mutex_unlock(&c1->lock); + ast_channel_unlock(c0); + ast_channel_unlock(c1); return -2; } if (pr0->set_udptl_peer(c0, p1)) { @@ -1038,8 +1038,8 @@ int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, /* Store UDPTL peer */ ast_udptl_get_peer(p0, &ac0); } - ast_mutex_unlock(&c0->lock); - ast_mutex_unlock(&c1->lock); + ast_channel_unlock(c0); + ast_channel_unlock(c1); cs[0] = c0; cs[1] = c1; cs[2] = NULL; -- cgit v1.2.3