diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-29 22:35:14 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-29 22:35:14 +0000 |
commit | a9f628879c92c39cf75c3ff6a30c5cf90d508490 (patch) | |
tree | d34c32efcac9d4db06b145e25e85d91e8e848208 /res | |
parent | 546ab36e0bf66e4b42b9fbbc7ee3b2e78a14eeb2 (diff) |
Merged revisions 198183 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r198183 | russell | 2009-05-29 17:33:31 -0500 (Fri, 29 May 2009) | 2 lines
Improve handling of trying to ACK too many timer expirations.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@198185 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_timing_pthread.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c index 5e3c31364..86ae1bb42 100644 --- a/res/res_timing_pthread.c +++ b/res/res_timing_pthread.c @@ -357,9 +357,21 @@ static int check_timer(struct pthread_timer *timer) static void read_pipe(struct pthread_timer *timer, unsigned int quantity) { int rd_fd = timer->pipe[PIPE_READ]; + int pending_ticks = timer->pending_ticks; ast_assert(quantity); - ast_assert(quantity >= timer->pending_ticks); + + if (timer->continuous && pending_ticks) { + pending_ticks--; + } + + if (quantity > pending_ticks) { + quantity = pending_ticks; + } + + if (!quantity) { + return; + } do { unsigned char buf[1024]; |