[asterisk-commits] file: branch 12 r423211 - in /branches/12: ./ res/res_rtp_asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 16 16:02:55 CDT 2014


Author: file
Date: Tue Sep 16 16:02:53 2014
New Revision: 423211

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

Side note: I need a vacation.
........

Merged revisions 423210 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/res/res_rtp_asterisk.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_rtp_asterisk.c?view=diff&rev=423211&r1=423210&r2=423211
==============================================================================
--- branches/12/res/res_rtp_asterisk.c (original)
+++ branches/12/res/res_rtp_asterisk.c Tue Sep 16 16:02:53 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;
 	}
 
@@ -1697,8 +1697,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 asterisk-commits mailing list