aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-05-12 04:23:55 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-05-12 04:23:55 +0000
commit57f1c73396a098a4ae9b93db577f7f13d4bf3a74 (patch)
treeea489daf4f7d64dce260b9e4c59e413de180437a /file.c
parent11dc83355e514517f8a7e5bb6b5a9de05a41dca0 (diff)
Use zaptel timers to wake up processes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1002 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'file.c')
-rwxr-xr-xfile.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/file.c b/file.c
index 466b8aa5a..4ad7fa974 100755
--- a/file.c
+++ b/file.c
@@ -615,12 +615,13 @@ char ast_waitstream(struct ast_channel *c, char *breakon)
ast_closestream(c->stream);
break;
}
+ /* Setup timeout if supported */
+ ast_settimeout(c, res);
res = ast_waitfor(c, res);
if (res < 0) {
ast_log(LOG_WARNING, "Select failed (%s)\n", strerror(errno));
return res;
- } else
- if (res > 0) {
+ } else if (res > 0) {
fr = ast_read(c);
if (!fr) {
#if 0
@@ -652,8 +653,8 @@ char ast_waitstream(struct ast_channel *c, char *breakon)
}
/* Ignore */
ast_frfree(fr);
- } else
- ast_sched_runq(c->sched);
+ }
+ ast_sched_runq(c->sched);
}
@@ -670,6 +671,7 @@ char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char
ast_closestream(c->stream);
break;
}
+ ast_settimeout(c, res);
res = ast_waitfor(c, res);
if (res < 0) {
ast_log(LOG_WARNING, "Select failed (%s)\n", strerror(errno));
@@ -733,6 +735,7 @@ char ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int
ast_closestream(c->stream);
break;
}
+ ast_settimeout(c, ms);
rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
if (!rchan && (outfd < 0) && (ms)) {
ast_log(LOG_WARNING, "Wait failed (%s)\n", strerror(errno));
@@ -776,8 +779,8 @@ char ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int
}
/* Ignore */
ast_frfree(fr);
- } else
- ast_sched_runq(c->sched);
+ }
+ ast_sched_runq(c->sched);
}