From: Russell Bryant Date: Fri, 29 May 2009 22:34:12 +0000 (+0000) Subject: Merged revisions 198183 via svnmerge from X-Git-Tag: 1.6.1.3-rc1~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08678cf81a48bda2cc9cb3fbb31b0ca40ca2ef54;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@198184 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c index 5e3c31364c..86ae1bb420 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];