[asterisk-commits] file: branch 13 r423212 - in /branches/13: ./ res/res_rtp_asterisk.c

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


Author: file
Date: Tue Sep 16 16:03:59 2014
New Revision: 423212

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=423212
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
........

Merged revisions 423211 from http://svn.asterisk.org/svn/asterisk/branches/12

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

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

Modified: branches/13/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_rtp_asterisk.c?view=diff&rev=423212&r1=423211&r2=423212
==============================================================================
--- branches/13/res/res_rtp_asterisk.c (original)
+++ branches/13/res/res_rtp_asterisk.c Tue Sep 16 16:03:59 2014
@@ -1031,7 +1031,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;
 	}
 
@@ -1700,8 +1700,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