diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-17 22:59:36 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-17 22:59:36 +0000 |
commit | b9f37c0e992c5cad53a18b2dc1fdc80e67f3f108 (patch) | |
tree | 1e819c9ba9585ae73612c3fd4abae94e5c9cd11a /channels/chan_alsa.c | |
parent | cb3876e55fa1af26516fc0304f91434eaa74ac70 (diff) |
convert various places that access the channel lock directly to use the channel lock wrappers
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82728 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_alsa.c')
-rw-r--r-- | channels/chan_alsa.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c index f043cbde3..2a61dec15 100644 --- a/channels/chan_alsa.c +++ b/channels/chan_alsa.c @@ -508,7 +508,7 @@ static int alsa_text(struct ast_channel *c, const char *text) static void grab_owner(void) { - while (alsa.owner && ast_mutex_trylock(&alsa.owner->lock)) { + while (alsa.owner && ast_channel_trylock(alsa.owner)) { ast_mutex_unlock(&alsalock); usleep(1); ast_mutex_lock(&alsalock); @@ -527,7 +527,7 @@ static int alsa_call(struct ast_channel *c, char *dest, int timeout) if (alsa.owner) { f.subclass = AST_CONTROL_ANSWER; ast_queue_frame(alsa.owner, &f); - ast_mutex_unlock(&alsa.owner->lock); + ast_channel_unlock(alsa.owner); } } else { ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n"); @@ -535,7 +535,7 @@ static int alsa_call(struct ast_channel *c, char *dest, int timeout) if (alsa.owner) { f.subclass = AST_CONTROL_RINGING; ast_queue_frame(alsa.owner, &f); - ast_mutex_unlock(&alsa.owner->lock); + ast_channel_unlock(alsa.owner); } write(sndcmd[1], &res, sizeof(res)); } @@ -901,7 +901,7 @@ static int console_answer(int fd, int argc, char *argv[]) if (alsa.owner) { struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER }; ast_queue_frame(alsa.owner, &f); - ast_mutex_unlock(&alsa.owner->lock); + ast_channel_unlock(alsa.owner); } answer_sound(); } @@ -950,7 +950,7 @@ static int console_sendtext(int fd, int argc, char *argv[]) f.data = NULL; f.datalen = 0; ast_queue_frame(alsa.owner, &f); - ast_mutex_unlock(&alsa.owner->lock); + ast_channel_unlock(alsa.owner); } } @@ -982,7 +982,7 @@ static int console_hangup(int fd, int argc, char *argv[]) grab_owner(); if (alsa.owner) { ast_queue_hangup(alsa.owner); - ast_mutex_unlock(&alsa.owner->lock); + ast_channel_unlock(alsa.owner); } } @@ -1010,7 +1010,6 @@ static int console_dial(int fd, int argc, char *argv[]) if (alsa.owner) { if (argc == 3) { d = argv[2]; - grab_owner(); if (alsa.owner) { struct ast_frame f = { AST_FRAME_DTMF }; while (*d) { @@ -1018,7 +1017,6 @@ static int console_dial(int fd, int argc, char *argv[]) ast_queue_frame(alsa.owner, &f); d++; } - ast_mutex_unlock(&alsa.owner->lock); } } else { ast_cli(fd, "You're already in a call. You can use this only to dial digits until you hangup\n"); |