[svn-commits] file: branch 11 r423210 - /branches/11/res/res_rtp_asterisk.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Sep 16 16:01:42 CDT 2014


Author: file
Date: Tue Sep 16 16:01:38 2014
New Revision: 423210

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=423210
Log:
res_rtp_asterisk: Fix 100% CPU usage due to timer heap thread spinning.

Side note: I need a vacation.

Modified:
    branches/11/res/res_rtp_asterisk.c

Modified: branches/11/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/res/res_rtp_asterisk.c?view=diff&rev=423210&r1=423209&r2=423210
==============================================================================
--- branches/11/res/res_rtp_asterisk.c (original)
+++ branches/11/res/res_rtp_asterisk.c Tue Sep 16 16:01:38 2014
@@ -1029,7 +1029,7 @@
 
 	pj_timer_heap_set_lock(ioqueue->timerheap, lock, PJ_TRUE);
 
-	if (pj_ioqueue_create(ioqueue->pool, 16, &ioqueue->ioqueue) != PJ_SUCCESS) {
+	if (pj_ioqueue_create(ioqueue->pool, PJ_IOQUEUE_MAX_HANDLES, &ioqueue->ioqueue) != PJ_SUCCESS) {
 		goto fatal;
 	}
 
@@ -1683,8 +1683,17 @@
 /*! \brief Worker thread for timerheap */
 static int timer_worker_thread(void *data)
 {
+	pj_ioqueue_t *ioqueue;
+
+	if (pj_ioqueue_create(pool, 1, &ioqueue) != PJ_SUCCESS) {
+		return -1;
+	}
+
 	while (!timer_terminate) {
+		const pj_time_val delay = {0, 10};
+
 		pj_timer_heap_poll(timer_heap, NULL);
+		pj_ioqueue_poll(ioqueue, &delay);
 	}
 
 	return 0;




More information about the svn-commits mailing list