summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg2010-07-06 17:53:21 +0200
committerAndreas Eversberg2010-07-06 17:53:21 +0200
commitec4c180567d94ada2940ca106b45e5876d6bbf3a (patch)
tree8ffb404cdea2cc3928d8762e1927184b4c746836
parentDisabled log_ast and replaced it by simple printf. (diff)
downloadlcr-ec4c180567d94ada2940ca106b45e5876d6bbf3a.tar.gz
lcr-ec4c180567d94ada2940ca106b45e5876d6bbf3a.tar.xz
lcr-ec4c180567d94ada2940ca106b45e5876d6bbf3a.zip
The "trylock" test patch.
-rw-r--r--chan_lcr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/chan_lcr.c b/chan_lcr.c
index a091fdb..5968733 100644
--- a/chan_lcr.c
+++ b/chan_lcr.c
@@ -1693,7 +1693,11 @@ static void handle_queue()
ast = call->ast;
if (*p && ast) {
lock_debug("A1+");
-// ast_channel_lock(ast);
+ while (ast_channel_trylock(ast)) {
+ lock_debug("<trylock failed>");
+ usleep(1000);
+ lock_debug("A1++");
+ }
lock_debug("A1-");
while(*p) {
switch (*p) {
@@ -1750,7 +1754,7 @@ static void handle_queue()
p++;
}
call->queue_string[0] = '\0';
-// ast_channel_unlock(ast);
+ ast_channel_unlock(ast);
lock_debug("a1");
}
call = call->next;