[svn-commits] russell: trunk r198183 - /trunk/res/res_timing_pthread.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 29 17:33:34 CDT 2009


Author: russell
Date: Fri May 29 17:33:31 2009
New Revision: 198183

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=198183
Log:
Improve handling of trying to ACK too many timer expirations.

Modified:
    trunk/res/res_timing_pthread.c

Modified: trunk/res/res_timing_pthread.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/res/res_timing_pthread.c?view=diff&rev=198183&r1=198182&r2=198183
==============================================================================
--- trunk/res/res_timing_pthread.c (original)
+++ trunk/res/res_timing_pthread.c Fri May 29 17:33:31 2009
@@ -357,9 +357,21 @@
 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];




More information about the svn-commits mailing list