summaryrefslogtreecommitdiff
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-09-17 22:59:36 +0000
committerRussell Bryant <russell@russellbryant.com>2007-09-17 22:59:36 +0000
commitded76a8988ccde91946fd7e05107d775010d3cfe (patch)
tree1e819c9ba9585ae73612c3fd4abae94e5c9cd11a /channels/chan_local.c
parent0d1abc92fe676c428d838cc128907f715c794e1b (diff)
convert various places that access the channel lock directly to use the channel lock wrappers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 17d6b7f4b..fb956ab64 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -184,11 +184,11 @@ retrylock:
ast_clear_flag(p, LOCAL_GLARE_DETECT);
return 0;
}
- if (ast_mutex_trylock(&other->lock)) {
+ if (ast_channel_trylock(other)) {
/* Failed to lock. Release main lock and try again */
ast_mutex_unlock(&p->lock);
if (us) {
- if (ast_mutex_unlock(&us->lock)) {
+ if (ast_channel_unlock(us)) {
ast_log(LOG_WARNING, "%s wasn't locked while sending %d/%d\n",
us->name, f->frametype, f->subclass);
us = NULL;
@@ -198,12 +198,12 @@ retrylock:
usleep(1);
/* Only we can destroy ourselves, so we can't disappear here */
if (us)
- ast_mutex_lock(&us->lock);
+ ast_channel_lock(us);
ast_mutex_lock(&p->lock);
goto retrylock;
}
ast_queue_frame(other, f);
- ast_mutex_unlock(&other->lock);
+ ast_channel_unlock(other);
ast_clear_flag(p, LOCAL_GLARE_DETECT);
return 0;
}
@@ -245,16 +245,16 @@ static void check_bridge(struct local_pvt *p, int isoutbound)
/* Lock everything we need, one by one, and give up if
we can't get everything. Remember, we'll get another
chance in just a little bit */
- if (!ast_mutex_trylock(&(p->chan->_bridge)->lock)) {
+ if (!ast_channel_trylock(p->chan->_bridge)) {
if (!ast_check_hangup(p->chan->_bridge)) {
- if (!ast_mutex_trylock(&p->owner->lock)) {
+ if (!ast_channel_trylock(p->owner)) {
if (!ast_check_hangup(p->owner)) {
ast_channel_masquerade(p->owner, p->chan->_bridge);
ast_set_flag(p, LOCAL_ALREADY_MASQED);
}
- ast_mutex_unlock(&p->owner->lock);
+ ast_channel_unlock(p->owner);
}
- ast_mutex_unlock(&(p->chan->_bridge)->lock);
+ ast_channel_unlock(p->chan->_bridge);
}
}
/* We only allow masquerading in one 'direction'... it's important to preserve the state