summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2006-12-15 06:31:26 +0000
committerJoshua Colp <jcolp@digium.com>2006-12-15 06:31:26 +0000
commit315f8bb1b22ffa6b81c1c5a71058c4a24351eaa6 (patch)
tree94f421159bc3f7f20ff61a68764b1cc0e98c34ec
parent112262198185c249a948bdb91d86427a909f781b (diff)
Merged revisions 48478 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r48478 | file | 2006-12-15 01:28:05 -0500 (Fri, 15 Dec 2006) | 2 lines Use a wakeup variable so that we don't wait on IO indefinitely if packets need to be retransmitted. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_iax2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 43aa7fbe7..0abe9206f 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -8098,7 +8098,7 @@ static void *network_thread(void *ignore)
{
/* Our job is simple: Send queued messages, retrying if necessary. Read frames
from the network, and queue them for delivery to the channels */
- int res, count;
+ int res, count, wakeup;
struct iax_frame *f;
if (timingfd > -1)
@@ -8109,13 +8109,16 @@ static void *network_thread(void *ignore)
sent, and scheduling retransmissions if appropriate */
AST_LIST_LOCK(&iaxq.queue);
count = 0;
+ wakeup = -1;
AST_LIST_TRAVERSE_SAFE_BEGIN(&iaxq.queue, f, list) {
if (f->sentyet)
continue;
/* Try to lock the pvt, if we can't... don't fret - defer it till later */
- if (ast_mutex_trylock(&iaxsl[f->callno]))
+ if (ast_mutex_trylock(&iaxsl[f->callno])) {
+ wakeup = 1;
continue;
+ }
f->sentyet++;
@@ -8146,7 +8149,7 @@ static void *network_thread(void *ignore)
ast_log(LOG_DEBUG, "chan_iax2: Sent %d queued outbound frames all at once\n", count);
/* Now do the IO, and run scheduled tasks */
- res = ast_io_wait(io, -1);
+ res = ast_io_wait(io, wakeup);
if (res >= 0) {
if (res >= 20 && option_debug)
ast_log(LOG_DEBUG, "chan_iax2: ast_io_wait ran %d I/Os all at once\n", res);