[asterisk-commits] file: trunk r369524 - /trunk/res/res_rtp_asterisk.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jul 1 19:35:42 CDT 2012
Author: file
Date: Sun Jul 1 19:35:40 2012
New Revision: 369524
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=369524
Log:
Ensure the timer heap is protected by a lock.
Modified:
trunk/res/res_rtp_asterisk.c
Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=369524&r1=369523&r2=369524
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Sun Jul 1 19:35:40 2012
@@ -3741,6 +3741,8 @@
static int load_module(void)
{
+ pj_lock_t *lock;
+
pj_log_set_level(0);
if (pj_init() != PJ_SUCCESS) {
@@ -3766,6 +3768,14 @@
pj_shutdown();
return AST_MODULE_LOAD_DECLINE;
}
+
+ if (pj_lock_create_recursive_mutex(pool, "rtp%p", &lock) != PJ_SUCCESS) {
+ pj_caching_pool_destroy(&cachingpool);
+ pj_shutdown();
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
+ pj_timer_heap_set_lock(timerheap, lock, PJ_TRUE);
if (pj_ioqueue_create(pool, 16, &ioqueue) != PJ_SUCCESS) {
pj_caching_pool_destroy(&cachingpool);
More information about the asterisk-commits
mailing list