summaryrefslogtreecommitdiffstats
path: root/chan_lcr.c
diff options
context:
space:
mode:
authorAndreas Eversberg2010-07-07 09:14:21 +0200
committerAndreas Eversberg2010-07-07 09:14:21 +0200
commit86dda4048a8de440e3911b08e8ca4f6da519d682 (patch)
tree5574bb402af711d7368d7ae8cd54cae1121dfefb /chan_lcr.c
parentThe "trylock" test patch. (diff)
downloadlcr-86dda4048a8de440e3911b08e8ca4f6da519d682.tar.gz
lcr-86dda4048a8de440e3911b08e8ca4f6da519d682.tar.xz
lcr-86dda4048a8de440e3911b08e8ca4f6da519d682.zip
Another "trylock" test.
Diffstat (limited to 'chan_lcr.c')
-rw-r--r--chan_lcr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/chan_lcr.c b/chan_lcr.c
index 5968733..53c814f 100644
--- a/chan_lcr.c
+++ b/chan_lcr.c
@@ -1687,16 +1687,21 @@ static void handle_queue()
struct ast_frame fr;
char *p;
+again:
call = call_first;
while(call) {
p = call->queue_string;
ast = call->ast;
if (*p && ast) {
lock_debug("A1+");
- while (ast_channel_trylock(ast)) {
+ if (ast_channel_trylock(ast)) {
lock_debug("<trylock failed>");
+ ast_mutex_unlock(&log_lock);
usleep(1000);
lock_debug("A1++");
+ ast_mutex_lock(&log_lock);
+ lock_debug("A1+-");
+ goto again;
}
lock_debug("A1-");
while(*p) {